如何不合并 CSS 文件

返回导航

#158

I created a mini gulp module to solve this problem. But, I think that can be better, so I don't uploaded the module yet. Basically I have app.js file, and constants with array of files to load. Something like this:

angular.module('app', [ngCssInjector])
.constant('mainViewCss', ['path/to/style1.css', 'path/to/style2.css',
'path/to/style3.css'])
.constant('loginViewCss', ['path/to/style2.css', 'path/to/style4.css',
'path/to/style5.css']).etc()

Then, cause I never injected that files on index.html, I take the files from the constant values in app.js and then just uglify and copy all files.

gulp.task('copy-extra-files', function(){
  return gulp.src('src/app/app.js')
    .pipe(ngContantValues())
    .pipe(minifyCSS())
    .pipe(gulp.dest(relativeDir));
});

The project is responsible for injecting the files is in https://github.com/CristianMR/ngcssinjector

返回导航

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容