prompt after running with webpack-- config build/webpack.base.conf.js command:
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration.module has an unknown property "rule". These properties are valid:
object { exprContextCritical?, exprContextRecursive?, exprContextRegExp?, exprContextRequest?, noParse?, rules?, defaultRules?, unknownContextCritical?, unknownContextRecursive?, unknownContextRegExp?, unknownContextRequest?, unsafeCache?, wrappedContextCritical?, wrappedContextRecursive?, wrappedContextRegExp?, strictExportPresence?, strictThisContextOnImports? }
-> Options affecting the normal modules (`NormalModuleFactory`).
my webpack.base.conf.js is as follows:
"use strict";
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
module.exports = {
entry: {
index: [
path.resolve(__dirname,"../src/main.js")
]
},
output: {
path: path.resolve(__dirname,"../dist/static"),
filename: "[name].[hash:8].js",
publicPath: "static/"
},
module: {
rule: [
{
test: /\.vue$/,
loader: "vue-loader"
},
{
test: /\.js$/,
loader: "babel-loader?presets=es2015",
exclude: /node_modules/
}
]
},
resolve: {
extensions: [".js",".vue"],
alias: {
"vue$":"vue/dist/vue.esm.js"
}
},
plugins: [
new HtmlWebpackPlugin({
filename: "../index.html",
template: path.resolve(__dirname,"../index.html")
})
]
}
looking at the error does not seem to be a path problem. For the first time, you don"t need vue-cli, to build the project structure step by step. If you make this mistake, you really don"t understand