Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const HtmlWebpackPlugin = require('html-webpack-plugin');
- const path = require('path');
- const webpack = require('webpack');
- const MiniCssExtractPlugin = require('mini-css-extract-plugin');
- const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
- module.exports = {
- entry: {
- index: "/home/robert/www/src/index.js",
- im1: "/home/robert/www/src/im1.js",
- "another/im1": "/home/robert/www/src/another/im1.js",
- "css/index": "/home/robert/www/src/main.css"
- },
- module: {
- rules: [
- {
- test: /\.css$/,
- use: [MiniCssExtractPlugin.loader, "css-loader"],
- },
- {
- test: /\.(png|svg|jpg|jpeg|gif)$/i,
- type: 'asset/resource',
- },
- ],
- },
- plugins: [new MiniCssExtractPlugin()],
- optimization: {
- minimizer: [
- // For webpack@5 you can use the `...` syntax to extend existing minimizers (i.e. `terser-webpack-plugin`), uncomment the next line
- // `...`,
- new CssMinimizerPlugin(),
- ],
- },
- };
Add Comment
Please, Sign In to add comment