【问题标题】:Vue JS dev server doesn't work in AtomVue JS 开发服务器在 Atom 中不起作用
【发布时间】:2017-12-30 17:02:53
【问题描述】:
我在 Visual Studio Code 中开始了我的网站项目,它运行了好几天。我发现了 Atom 并决定转向它。不知何故,每当我在 Atom 中启动开发服务器时,每个 Vue 组件都会吐出:
Console output (pastebin)
"Error: "extract-text-webpack-plugin" loader is used without the corresponding
plugin"
网页只呈现
Cannot GET /
开发服务器在 Visual Studio Code 中可以正常启动,但在 Atom 中则不行
【问题讨论】:
标签:
javascript
node.js
npm
vue.js
【解决方案1】:
我在 Win7 上从 CMD 运行 npm run dev 时遇到了同样的问题。
我不知道,因为我在任何地方都没有明确要求这个插件,而且当我开始这个错误时,我也没有发生这个错误。
由于我也开始遇到此错误,并且我已经尝试设置此issue report from the official repo 提供的NODE_ENV=development,因此我尝试过玩。
最后我最终编辑了webpack.dev.conf.js,将这个特定的插件添加到插件键中,如下所示:
// File header with other Imports
var utils = require('./utils')
// ...
var ExtractTextPlugin = require('extract-text-webpack-plugin')
// Then in Module definition
module.exports = merge(baseWebpackConfig, {
// ... other keys for module
plugins: [
// .. other plugins
// .. I copied this line from the webpack.prod.conf.js
new ExtractTextPlugin({
filename: utils.assetsPath('css/[name].[contenthash].css')
}),
嗯,可能会有更好、更漂亮的解决方案。
这只是似乎为我解决它的一个。
由于我是 VueJs 的新手,并且我目前仅使用开发服务器进行自动重载,因此其他答案可能会更加完善。