Advertisement
Guest User

weboack.config.js

a guest
Oct 28th, 2020
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const MiniCssExtractPlugin = require('mini-css-extract-plugin');
  2. const path = require('path');
  3. module.exports = {
  4.     mode: 'production',
  5.     entry: './src/index.js',
  6.     output: {
  7.         filename: 'main.js',
  8.         path: path.resolve(__dirname, 'dist/js'),
  9.     },
  10.     module: {
  11.         rules: [
  12.             {
  13.                 test: /\.js$/,
  14.                 exclude: /node_modules/,
  15.                 use: {
  16.                     loader: 'babel-loader',
  17.                     options: {
  18.                         presets: [['@babel/preset-env', {
  19.                             useBuiltIns: "usage",
  20.                             corejs: 3,
  21.                             modules: false
  22.                         }]]
  23.                     }
  24.                 }
  25.             },
  26.             {
  27.                 test: /\.(sa|sc|c)ss$/,
  28.                 exclude: /node_modules/,
  29.                 use: [
  30.                     MiniCssExtractPlugin.loader,
  31.                     {
  32.                         loader: 'css-loader',
  33.                         options: { url: false }
  34.                     },
  35.                     {
  36.                         loader: 'postcss-loader',
  37.                         options: {
  38.                             postcssOptions: {
  39.                                 plugins: [ require('autoprefixer') ]
  40.                             }
  41.                         }
  42.                     },
  43.                     'sass-loader'
  44.                 ]
  45.             }
  46.         ]
  47.     },
  48.     plugins: [
  49.         new MiniCssExtractPlugin({
  50.             filename: '../css/style.css',
  51.         })
  52.     ],
  53. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement