该篇仅针对整体的升级,具体细微的踩坑经历将在同个专栏继续更新
npm install webpack@latest
npm install webpack-cli@latest
npm install mini-css-extract-plugin@latest
npm install html-webpack-plugin@latest
new webpack.IgnorePlugin({
resourceRegExp: /^\.\/locale$/,
contextRegExp: /moment/,
})
cache: {
type: 'filesystem',
}
resolve: {
fallback: {
"path": require.resolve("path-browserify"),
"crypto": require.resolve("crypto-browserify"),
}
}
^(inline-|hidden-|eval-)?(nosources-)?(cheap-(module-)?)?source-map$
npm install @vue/cli-service@latest
(底层webpack5)npm install webpack@latest
(webpack版本与vue-cli版本一致)cache: {
type: 'filesystem',
}
resolve: {
fallback: {
"path": require.resolve("path-browserify"),
"crypto": require.resolve("crypto-browserify"),
}
}
new webpack.IgnorePlugin({
resourceRegExp: /^\.\/locale$/,
contextRegExp: /moment/,
})