所以我尝试使用webpack编译一些vue.js
代码,但是当我尝试从命令提示符运行webpack时,我收到以下错误:
ERROR in Cannot find module 'core-js/library/fn/symbol/iterator'
。
我无法理解这个错误,而且我不知道我是否遗漏了任何依赖关系。
如果有些事情不对,请告诉我。
这是我的webpack.config
:
module.exports = {
// This is the "main" file which should include all other modules
entry: './view/vue/main.js',
// Where should the compiled file go?
output: {
path: './layout/standard/js',
filename: 'vue-build.js'
},
module: {
// Special compilation rules
loaders: [
{
test: /\.js$/,
loader: 'babel',
exclude: /node_modules/
},
{
test: /\.vue$/,
loader: 'vue'
}
]
},
vue: {
loaders: {
js: 'babel'
}
}
}
package.json
:
{
"author": "CDG",
"license": "ISC",
"private": true,
"scripts": {
"prod": "gulp -p | webpack -p",
"dev": "gulp watch | webpack --watch"
},
"dependencies": {
"vue": "^1.0.27",
"vue-clickaway": "^1.1.3",
"vue-resource": "^0.9.3",
"vue-socket.io": "^1.0.2",
"vue-spinner": "^1.0.2",
"vuex": "^1.0.0-rc.2"
},
"devDependencies": {
"babel-core": "^6.1.2",
"babel-loader": "^6.1.0",
"babel-plugin-transform-runtime": "^6.1.2",
"babel-preset-es2015": "^6.14.0",
"babel-preset-stage-0": "^6.1.2",
"babel-runtime": "^5.8.0",
"css-loader": "^0.23.0",
"style-loader": "^0.13.0",
"vue-html-loader": "^1.0.0",
"vue-loader": "^7.3.0",
"webpack": "^1.12.2"
}
}
.babelrc
:
{
"presets": ["es2015", "stage-0"],
"plugins": ["transform-runtime"]
}
请帮助我解决这个问题,这真的让我烦恼。 谢谢!
编辑:
我确实设法解决了运行npm i core-js
的问题,但现在输入webpack时遇到以下错误:ERROR in Cannot find module "./_baseClone"
,我错过了什么?