首頁>Club>
4
回覆列表
  • 1 # 吉他走調

    HtmlPlugin外掛裡配置:

    var htmlWebpackPlugin = require("html-webpack-plugin");

    const CleanWebpackPlugin = require("clean-webpack-plugin");

    let pathsToClean = [

    "dist",

    ];

    module.exports = {

    entry: "./src/app.js",

    output: {

    path: __dirname + "/dist",

    filename: "main.[chunkhash].js",

    },

    plugins: [

    new htmlWebpackPlugin({

    template: "./src/footer.html",

    hash: true,

    filename: "footer.html",

    minify: {

    collapseWhitespace: false

    }

    }),

    new CleanWebpackPlugin(pathsToClean),

    ],

    module: {

    rules: [

    {

    test: /\.css$/,

    use: ["style-loader", "css-loader"]

    }

    ]

    }

    };

  • 中秋節和大豐收的關聯?
  • “學霸、學神”都有哪些好的習慣和思維?