慕的地2499907
2018-09-11 15:54
ERROR in ./src/index.js 1:16
Module parse failed: Unexpected token (1:16)
You may need an appropriate loader to handle this file type.
> import Vue from vue;
| import App from './app.vue';
|
我找到了答案,分享给大家。
只要修改webpack.config.js就可以打包了。
const path = require('path');
const {VueLoaderPlugin}=require('vue-loader');
module.exports = {
entry: path.resolve(__dirname, "src/index.js"), //webpack4官方绝对路径
devServer: {
contentBase: './dist'
},
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist')
},
module: {
rules: [
{
test: /\.vue$/,
use: [
'vue-loader'
]
},
{
test: /\.css$/,
use: [
'vue-style-loader', //可以不要
'style-loader',
'css-loader'
]
},
]
},
plugins:[
new VueLoaderPlugin()
]
};
谁能帮忙看下啊
Vue+Webpack打造todo应用
84606 学习 · 787 问题
相似问题