forked from RealDeuce/torch
-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathwebpack.config.js
32 lines (31 loc) · 910 Bytes
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
const path = require("path");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
module.exports = {
context: __dirname + "/src",
entry: { torch: "./torch.mjs" },
output: {
filename: "[name].js", // [name] will take whatever the input filename is. defaults to 'main' if only a single entry value
path: path.resolve(__dirname, "dist"), // the folder containing you final dist/build files. Default to './dist'
clean: true,
},
module: {
rules: [
{
test: /\.css$/,
use: [
{
loader: MiniCssExtractPlugin.loader,
},
"css-loader",
],
},
],
},
plugins: [
// the plugin to extract our css into separate .css files
new MiniCssExtractPlugin({
filename: "[name].[contenthash].css",
}),
],
devtool: "source-map", // supposedly the ideal type without bloating bundle size}
};