为了账号安全,请及时绑定邮箱和手机立即绑定

正在回答

4 回答

出现了同样的错误,根据https://vue-loader.vuejs.org/guide/提示,修改为如下内容即可。

const path = require('path')

const { VueLoaderPlugin } = require('vue-loader')


module.exports = {

mode: 'development',


entry: './src/index.js',


output: {

path: path.resolve(__dirname, 'dist'),

filename: 'bundle.js'

},


module: {

rules: [

{

test: /\.vue$/,

loader: 'vue-loader'

},

// this will apply to both plain .js files

// AND <script> blocks in vue files

{

test: /\.js$/,

loader: 'babel-loader'

},

// this will apply to both plain .css files

// AND <style> blocks in vue files

{

test: /\.css$/,

use: [

'vue-style-loader',

'css-loader'

]

}

]

},

plugins: [

// make sure to include the plugin for the magic

new VueLoaderPlugin()

]

}

可能还会有错误,例如“ERROR in Entry module not found: Error: Can't resolve 'babel-loader' in 'C:\Users\hbs\own\project\vuetest'”之类的,安装相应包即可。

1 回复 有任何疑惑可以回复我~
#1

慕先生6553767 提问者

非常感谢!
2018-04-27 回复 有任何疑惑可以回复我~

666老铁给力,刚刚接触,还是多谢大家帮助

0 回复 有任何疑惑可以回复我~

OK了 ,非常感谢

0 回复 有任何疑惑可以回复我~

求代码贴图 。同样的问题

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
Vue+Webpack打造todo应用
  • 参与学习       84609    人
  • 解答问题       786    个

用前端最热门框架Vue+最火打包工具Webpack打造todo应用

进入课程

npm run build 出错了

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信