下面是我的webpack.config.js和package.json
module.exports = {
entry: "./entry.js",
output: {
filename: "./build/js/bundle.js"
},
module: {
rules: [
{
test: /.\js$/,
use: [
{
loader: 'babel-loader',
options: {
presets: ["es2015"]
}
}
]
},
{
test: /.\css?$/,
include: __dirname + "./src/css",
exclude: __dirname + "./src/js",
use: [
'style-loader',
{
loader: 'css-loader',
options: {
modules: true
}
}
]
}
]
},
plugins: [
// new UglifyJsPlugin()
]
}
"dependencies": {
"ajv-keywords": "^3.1.0",
"ajv": "^6.0.0",
"axios": "^0.17.1",
"babel-minify-webpack-plugin": "^0.3.0",
"extract-text-webpack-plugin": "^3.0.2",
"install": "^0.10.4",
"npm": …
Run Code Online (Sandbox Code Playgroud)