Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. const path = require('path');
  2. const MiniCssExtractPlugin = require('mini-css-extract-plugin');
  3.  
  4.  
  5. module.exports = function (env, argv) {
  6. const isProduction = argv.mode === "production"
  7. const plugins = [];
  8.  
  9. plugins.push(
  10. new MiniCssExtractPlugin({
  11. filename: 'style.css',
  12. ignoreOrder: false
  13. })
  14. )
  15.  
  16. return {
  17. entry: {
  18. script: path.resolve(__dirname, 'src/index.js')
  19. },
  20. output: {
  21. path: path.resolve(__dirname, 'dist'),
  22. filename: '[name].js'
  23. },
  24. plugins,
  25. module: {
  26. rules: [
  27. {
  28. test: /\.less$/,
  29. use: [
  30. { loader: MiniCssExtractPlugin.loader },
  31. 'css-loader',
  32. 'clean-css-loader',
  33. 'less-loader'
  34. ]
  35. }
  36. ]
  37. }
  38. };
  39. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement