使用vux报错Failed to mount component:template or render function
我按照vux文档配置了webpack.config.js,然后就报这个错,我又查了下说是改resolve里的alias就可以,可我改完了还是不管用
这是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']
})
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我也遇到这个问题了,鼓捣了一下午了
请问这个问题解决了吗,如何解决呢