webpack.config.js 494 B

1234567891011121314151617181920212223
  1. import ExtractTextPlugin from 'extract-text-webpack-plugin';
  2. import OptimizeCssAssetsPlugin from '../../../src/';
  3. module.exports = {
  4. entry: './index',
  5. module: {
  6. rules: [
  7. {
  8. test: /\.css$/,
  9. use: ExtractTextPlugin.extract({
  10. fallback: { loader: 'style-loader' },
  11. use: {
  12. loader: 'css-loader',
  13. options: { minimize: true }
  14. }
  15. })
  16. },
  17. ],
  18. },
  19. plugins: [
  20. new ExtractTextPlugin('file.css')
  21. ],
  22. };