要不然哪個成功了的老哥,發一下package.json的依賴,,版本問題確實比較 難受啊,先謝了
2018-03-21
if(isDev){
config.devtool="#cheap-module-eval-source-map"
config.devServer={
port:8080,
host:'0.0.0.0', //可以通過內網的ip進行防問,也可以通過localhost訪問
overlay:{
errors:true
},
}
host:必須設置為 127.0.0.1, 不然報網址為 http://0.0.0.0:8080/ 的網頁可能暫時無法連接,或者它已永久性地移動到了新網址 錯誤
config.devtool="#cheap-module-eval-source-map"
config.devServer={
port:8080,
host:'0.0.0.0', //可以通過內網的ip進行防問,也可以通過localhost訪問
overlay:{
errors:true
},
}
host:必須設置為 127.0.0.1, 不然報網址為 http://0.0.0.0:8080/ 的網頁可能暫時無法連接,或者它已永久性地移動到了新網址 錯誤
2018-03-20
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] dev: `cross-env NODE_ENV=development webpack-dev-server --config webpack.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] dev script.
npm ERR! errno 1
npm ERR! [email protected] dev: `cross-env NODE_ENV=development webpack-dev-server --config webpack.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] dev script.
2018-03-19
學友們注意:webpack4刪除了CommonsChunkPlugin,所以視頻中對應的添加vendor的方法應改為:在else下新增“optimization:{cacheGroups:{vendor:{name:'vendor'}}}”,親測有效。
2018-03-19
extract-text-webpack-plugin暫時不支持webpack4,大家可以使用“npm i extract-text-webpack-plugin@next”來解決。
2018-03-19
按照以下方式(老師的版本較舊)就不會出錯
1.npm init(初始化)
2.npm [email protected] vue vue-loader
3.npm css-loader vue-template-compiler
注意:1.__dirname有兩個下劃線;2.語法錯誤在執行npm run build命令后出現的代碼的第四行查看,有個尖箭頭指著;
1.npm init(初始化)
2.npm [email protected] vue vue-loader
3.npm css-loader vue-template-compiler
注意:1.__dirname有兩個下劃線;2.語法錯誤在執行npm run build命令后出現的代碼的第四行查看,有個尖箭頭指著;
2018-03-19
$ npm run build
> [email protected] build E:\www\vue-todo
> webpack --config webpack.config.js
npm ERR! code ELIFECYCLE
npm ERR! [email protected] build: `webpack --config webpack.config.js`
npm ERR! Failed at the [email protected] build script.
> [email protected] build E:\www\vue-todo
> webpack --config webpack.config.js
npm ERR! code ELIFECYCLE
npm ERR! [email protected] build: `webpack --config webpack.config.js`
npm ERR! Failed at the [email protected] build script.
2018-03-18
Invalid configuration object. Webpack has been initialised using a configuration object that does not matc
h the API schema.
- configuration.module.rules[2] has an unknown property 'text'. These properties
h the API schema.
- configuration.module.rules[2] has an unknown property 'text'. These properties
2018-03-16
npm run build報錯: output: {
^^^^^^
SyntaxError: Unexpected identifier
^^^^^^
SyntaxError: Unexpected identifier
2018-03-16