nodejs打包有时候会出现文件过大的问题
- Building for production...[BABEL] Note: The code generator has deoptimised the styling of D:\javaProject\platform\backend-ui-lanyuancc\backend-ui-lanyuancc\src\components\AddressCascader\address.js as it exceeds the max of 500KB.
ERROR Error: error:0308010C:digital envelope routines::unsupported
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:69:19)
at Object.createHash (node:crypto:133:10)
at D:\javaProject\platform\backend-ui-lanyuancc\backend-ui-lanyuancc\node_modules\compression-webpack-plugin\dist\index.js:243:42
at CompressionPlugin.compress (D:\javaProject\platform\backend-ui-lanyuancc\backend-ui-lanyuancc\node_modules\compression-webpack-plugin\dist\index.js:284:9)
at D:\javaProject\platform\backend-ui-lanyuancc\backend-ui-lanyuancc\node_modules\compression-webpack-plugin\dist\index.js:305:12
at _next3 (eval at create (D:\javaProject\platform\backend-ui-lanyuancc\backend-ui-lanyuancc\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:9:17)
at eval (eval at create (D:\javaProject\platform\backend-ui-lanyuancc\backend-ui-lanyuancc\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:35:1)
at D:\javaProject\platform\backend-ui-lanyuancc\backend-ui-lanyuancc\node_modules\copy-webpack-plugin\dist\index.js:91:9
可以使用:
set NODE_OPTIONS=--openssl-legacy-provider
npm run build:prod