mirror of
https://github.com/VickScarlet/lifeRestart.git
synced 2025-07-16 09:03:55 +08:00
add webpack
This commit is contained in:
41
webpack.config.cjs
Normal file
41
webpack.config.cjs
Normal file
@@ -0,0 +1,41 @@
|
||||
const path = require('path');
|
||||
|
||||
module.exports = {
|
||||
entry: './src/index.js',
|
||||
mode: 'production',
|
||||
output: {
|
||||
path: path.resolve(__dirname, 'public'),
|
||||
filename: 'bundle.js',
|
||||
},
|
||||
// resolve: {
|
||||
// extensions: [".js"],
|
||||
// },
|
||||
module: {
|
||||
rules: [{
|
||||
test: /\.js$/,
|
||||
exclude: /node_modules/,
|
||||
use: {
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
presets: [
|
||||
[
|
||||
'@babel/preset-env',
|
||||
{
|
||||
"targets": {
|
||||
"ie": 7,
|
||||
"edge": "17",
|
||||
"firefox": "60",
|
||||
"chrome": "67",
|
||||
"safari": "11.1",
|
||||
},
|
||||
// 按需加载
|
||||
"useBuiltIns": "usage",
|
||||
"corejs": "3.8.3",
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}]
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user