-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
37 lines (37 loc) · 1 KB
/
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
33
34
35
36
37
let path = require("path");
let compilerFeTest = require("./plugin");
let compilerFeTestA = require("./pluginA");
let compilerFeTestC = require("./pluginC");
module.exports = {
mode: "production",
entry: "./src/index.js",
output: {
path: path.join(__dirname, "dist"),
filename: "bundle.js",
},
resolveLoader: {
modules: ["node_modules", "./loaders"],
},
module: {
rules: [
{
test: /\.js1$/,
use: [
{
loader: path.resolve(__dirname, "./loaders/replace.js"),
options: {
name: "username",
},
},
],
},
],
},
plugins: [
new compilerFeTest({ tip: "这里是插件接收的参数哦" }),
new compilerFeTestA(() => {
console.log("这里是异步");
}),
new compilerFeTestC({ options: 0 }),
],
};