Advertisement
Guest User

webpack.config.js

a guest
Dec 3rd, 2019
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. const path = require('path')
  2. const MiniCssExtractPlugin = require('mini-css-extract-plugin')
  3.  
  4. module.exports = {
  5. entry: {
  6. app: "./src/index.js"
  7. },
  8. output: {
  9. filename: "[name].js",
  10. path: path.resolve(__dirname, './dist/'),
  11. publicPath: "/dist/"
  12. },
  13. module : {
  14. rules: [
  15. {
  16. test: /\.js$/,
  17. exclude: '/node_modules/',
  18. loader: 'babel-loader'
  19. },
  20. {
  21. test: /\.css$/,
  22. use: [
  23. {
  24. loader: MiniCssExtractPlugin.loader
  25. },
  26. {
  27. loader: 'css-loader'
  28. },
  29. {
  30. loader: 'postcss-loader',
  31. options: {config: {path:'src/js/postcss.config.js'}}
  32. }
  33. ]
  34. }
  35. ]
  36. },
  37. devServer: {
  38. overlay: true
  39. },
  40. plugins: [
  41. new MiniCssExtractPlugin({
  42. filename: "[name].css"
  43. })
  44. ],
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement