您好,欢迎来到二三四教育网。
搜索
您的当前位置:首页如何不合并 CSS 文件

如何不合并 CSS 文件

来源:二三四教育网

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));
});

Copyright © 2019- how234.cn 版权所有 赣ICP备2023008801号-2

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务