FluidHelloWorld/webpack.config.js

39 строки
768 B
JavaScript
Исходник Обычный вид История

/*!
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
const CopyPlugin = require("copy-webpack-plugin");
const HtmlWebpackPlugin = require("html-webpack-plugin");
2022-10-18 02:55:41 +03:00
module.exports = (env) => {
const htmlTemplate = "./src/index.html";
const plugins = [
new HtmlWebpackPlugin({ template: htmlTemplate }),
new CopyPlugin({
patterns: [
// Copy assets from `public`
{ from: ".", to: ".", context: "public" },
],
}),
];
const mode = env && env.prod ? "production" : "development";
return {
devtool: "inline-source-map",
entry: {
app: "./src/app.js",
},
mode,
output: {
filename: "[name].[contenthash].js",
clean: true,
},
plugins,
devServer: {
open: false,
},
};
};