解决方法
{ test: /\.css$/,use: [ { loader: 'css-loader',options: { minimize: true } } ] }
编辑1(2014年9月16日):更好的是,现在你有任务赛跑者,如Gulp或Grunt.
Task runners are small applications that are used to automate many of
the time consuming,boring (but very important) tasks that you have to
do while developing a project. These include tasks such as running
tests,concatenating files,minification,and CSS preprocessing. By
simply creating a task file,you can instruct the task runner to
automatically take care of just about any development task you can
think of as you make changes to your files. It’s a very simple idea
that will save you a lot of time and allow you to stay focused on
development.
必读:Getting started with Gulp.js
使用JavaScript连接和分类(和JSHint)的任务示例:
gulp.task('scripts',function() { return gulp.src('src/scripts/**/*.js') .pipe(jshint('.jshintrc')) .pipe(jshint.reporter('default')) .pipe(concat('main.js')) .pipe(gulp.dest('dist/assets/js')) .pipe(rename({suffix: '.min'})) .pipe(uglify()) .pipe(gulp.dest('dist/assets/js')) .pipe(notify({ message: 'Scripts task complete' })); });
原来的答案(2012年7月19日):我建议HTML5 Boilerplate Build Script可以减少你的JS和CSS.
原文地址:https://www.jb51.cc/css/214709.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。