wowtoken.app

git clone https://git.emily.sh/wowtoken-app/wowtoken.app.git
Log | Files | Refs | README | LICENSE

webpack.config.js (836B)


      1 const path = require('path');
      2 const HtmlWebpackPlugin = require('html-webpack-plugin');
      3 const MiniCssExtractPlugin = require("mini-css-extract-plugin");
      4 const CssMinimizerPlugin = require("css-minimizer-webpack-plugin");
      5 
      6 
      7 module.exports = {
      8   entry: './src/index.js',
      9   module: {
     10     rules: [
     11       {
     12         test: /.s?css$/,
     13         use: [MiniCssExtractPlugin.loader, "css-loader"],
     14       },
     15     ],
     16   },
     17   optimization: {
     18     minimize: true,
     19     minimizer: [
     20       `...`,
     21       new CssMinimizerPlugin(),
     22     ],
     23   },
     24   plugins: [
     25     new MiniCssExtractPlugin({
     26       filename: '[name].[contenthash].css'
     27     }),
     28     new HtmlWebpackPlugin({
     29       template: "src/index.html"
     30     }),
     31   ],
     32   output: {
     33     filename: '[name].[contenthash].js',
     34     path: path.resolve(__dirname, 'dist'),
     35     libraryTarget: 'window',
     36     clean: true,
     37   },
     38 };