關(guān)于webpack4.0+以上版本 npm run build 報(bào)錯(cuò)問(wèn)題的解決
關(guān)于版本升級(jí)的報(bào)錯(cuò),解決代碼如下(webpack.config.js 頁(yè)面,增加2處代碼):
const?path?=?require('path') //此處 const?VueLoaderPlugin?=?require('vue-loader/lib/plugin') module.exports?=?{ ????entry:?path.join(__dirname,'src/index.js'), ????output:?{ ????????filename:?"bundle.js", ????????path:?path.join(__dirname,'dist'), ????}, ????module:{ ????????rules:?[ ????????????{ ????????????????test:?/\.vue$/, ????????????????loader:?'vue-loader' ????????????}, ????????????{ ????????????????test:?/\.css$/, ????????????????use:?[ ????????????????????'style-loader', ????????????????????'css-loader' ????????????????] ????????????} ????????] ????}, ????//此處 ????plugins:?[ ????????new?VueLoaderPlugin() ????] }
2018-11-10
我的webpack用的是4.0+版本,請(qǐng)問(wèn)下為啥會(huì)報(bào)Cannot find module 'webpack'錯(cuò)誤,我將node_modules下面的webpack刪除重新使用npm install webpack-dev-server指令安裝也還是報(bào)這個(gè)錯(cuò)誤...
2018-11-09
https://blog.csdn.net/yangluan999/article/details/79980275? 根據(jù)這篇文章的配置搞定了
2018-11-08
當(dāng)然了,也可以下載指定webpack指定版本: