I configured webpack.config.js, according to the vux document and reported this error. I checked again and said that it was OK to change the alias in resolve, but it still didn"t work after I finished it.
this is webpack.config.js
const path = require("path");
const htmlWebpackPlugin = require("html-webpack-plugin");
const VueLoaderPlugin = require("vue-loader/lib/plugin");
const vuxLoader = require("vux-loader")
const webpackConfig = {
mode: "development",
entry: "./src/index.js",
output: {
path: path.resolve(__dirname, "dist"),
filename: "bundle.js",
},
resolve: {
alias: {
"vue$": "vue/dist/vue.js"
},
extensions: [".js", ".vue", ".json", ".less"],
},
plugins: [
new htmlWebpackPlugin({
template: path.join(__dirname, "./src/index.html"),
filename: "index.html"
}),
// make sure to include the plugin for the magic
new VueLoaderPlugin()
],
module: {
rules: [
{ test: /\.css$/, use: ["style-loader", "css-loader"] },
{ test: /\.less$/, use: ["style-loader", "css-loader", "less-loader"] },
{ test: /\.scss$/, use: ["style-loader", "css-loader", "sass-loader"] },
{ test: /\.(jpg|png|gif|bmp|jpeg)$/, use: "url-loader " },
{ test: /\.(ttf|eot|svg|woff|woff2)$/, use: "url-loader" },
{ test: /\.js$/, exclude: /node_modules/, loader: "babel-loader" },
{ test: /\.vue$/, use: "vue-loader" }
]
}
};
module.exports = vuxLoader.merge(webpackConfig, {
plugins: ["vux-ui"]
})