webpack.config.js 538 B

12345678910111213141516171819202122232425
  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. }
  14. })
  15. },
  16. ],
  17. },
  18. plugins: [
  19. new ExtractTextPlugin('file.css'),
  20. new OptimizeCssAssetsPlugin({
  21. assetNameRegExp: /optimize-me\.css/g
  22. })
  23. ],
  24. };