1

1) I've got an angular app setup with "best practices for angular app structure". So each section's folder may have it's own *.scss file. Need to convert the *.scss to *.css, and output the *.css file in the same folder.

Been messing around with it in Gulp for a few hours but can't get the syntax right. It's giving me lots of different behaviors, none of which are desired.

Anyone know Gulp a little better?

2) Seperate Gulp question, uglify works to minify both CSS and JS files? Or is there a separate plugin to use for minifying CSS?

3) Is there a plugin to minify HTML files too? Not too familiar with what's available. Still trying to learn from an example, but they mangled all the different plugins together, and I don't need to use all of them. But as I pull them apart, I'm breaking a lot of things, so it's really time consuming to get things working. I can spend days on this, trying to get it to work properly.

4

1 に答える 1

2
  1. はい、うなり声よりも Gulp が大好きです。github に例の要点があります。ここで確認できます: https://gist.github.com/manar007/7ce4dd0bdd9b76edb2ea。大規模なプロジェクト向けです。参考になると思います
  2. 使用gulp-minify-cssし、ほとんどが CSS 用に構成されています
  3. angularベースのアプリケーションを構築しているため、templateCacheを構成し、すべてのHTMLをそれに入れてから、jsファイルと連結するより良い方法は、別のファイルのように埋め込むか gulp-angular-templatecache
gulp.task('build-template-cache', function () {
  var stream = gulp.src('/app/**/*.html')
    .pipe(templateCache({
      module:'yourAngularModuleName'
    }))
    .pipe(gulp.dest(config.distDir + '/js'));
  return stream;
});

上記の要点リンクで見つけることができる他の例。

于 2014-10-06T06:09:00.837 に答える