webpack打包已配置vue-loader打包时仍报错You may need an appropriate loader.
webpack打包已配置了vue-loader但打包时仍报错
webpack.config.js
const path = require('path');
module.exports = {
entry: __dirname+"/app/index.js",
output: {
path: __dirname+"/build",
filename: "bundle.js"
},module: {
rules: [
{
test: /\.vue$/,
use: [
{ loader: 'vue-loader' },
]
}
]
}
};
报错:
package.json
{
"name": "todolist",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "webpack --config webpack.config.js"
},
"author": "",
"license": "ISC",
"devDependencies": {
"babel-cli": "^6.26.0",
"css-loader": "^0.28.11",
"vue": "^2.5.16",
"vue-loader": "^14.2.2",
"vue-template-compiler": "^2.5.16",
"webpack": "^4.5.0"
},
"dependencies": {},
"description": ""
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你这是解析JS文件的 babel-loader 没有配置的报错信息 ,
你只配置了一个 vue-loader。