vue.js - vue-cil安装后运行npm run dev报错

查看:520
本文介绍了vue.js - vue-cil安装后运行npm run dev报错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

如题,我按照各种教程尝试过安装vue-cil无数次了,每次启动都是报错插件"extract-text-webpack-plugin"

错误报告里面@出来的位置我也没看见有用过这个插件的语法啊

完整的错误报告在这里:

error  in ./src/App.vue

Module build failed: Error: "extract-text-webpack-plugin" loader is used without the
corresponding plugin, refer to https://github.com/webpack/extract-text-webpack-plugin
 for the usage example
    at Object.module.exports.pitch (F:\vue2\node_modules\extract-text-webpack-plugin\
loader.js:25:9)

 @ ./src/App.vue 2:2-371
 @ ./src/main.js
 @ multi ./build/dev-client ./src/main.js

 error  in ./src/components/Hello.vue

Module build failed: Error: "extract-text-webpack-plugin" loader is used without the

corresponding plugin, refer to https://github.com/webpack/extract-text-webpack-plugin
 for the usage example
    at Object.module.exports.pitch (F:\vue2\node_modules\extract-text-webpack-plugin\
loader.js:25:9)

 @ ./src/components/Hello.vue 2:2-381
 @ ./src/router/index.js
 @ ./src/main.js
 @ multi ./build/dev-client ./src/main.js

main.js在这里

import Vue from 'vue'
import App from './App'
import router from './router'

Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  template: '<App/>',
  components: { App }
})

解决方案

run dev
我这几天也在写一个vue项目,上面是个博客,记录了一些遇到的问题。可以参考一下哈

可将build\dev-server.js中对应部分改为

// if (!process.env.NODE_ENV) {
  process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV)
// }
//去掉if判断,使process.env.NODE_ENV只能从配置文件中读取

这篇关于vue.js - vue-cil安装后运行npm run dev报错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆