-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.npm.config.js
More file actions
38 lines (37 loc) · 895 Bytes
/
webpack.npm.config.js
File metadata and controls
38 lines (37 loc) · 895 Bytes
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
38
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
module.exports = {
mode: "development",
devtool: false,
entry: {
index: ["@babel/polyfill", "./src/MConfigForm/index.js"],
},
output: {
path: path.resolve(__dirname, "lib"),
filename: "[name].js",
},
externals: {
react: "react", //打包时候排除react
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: "babel-loader",
options: {
presets: ["@babel/preset-env"],
plugins: ["@babel/transform-runtime"],
},
},
},
{
test: /\.css$/,
use: ["style-loader", "css-loader"],
},
],
},
plugins: [new CleanWebpackPlugin()],
};