gpt4 book ai didi

node.js - npm 运行生产后,vendor.js 很大

转载 作者:太空宇宙 更新时间:2023-11-03 23:55:35 28 4
gpt4 key购买 nike

我使用基于 Laravel 和 Vue.js 的 Laravue Dashboard,在在线服务器上运行,而不是本地主机,它是全新安装,没有进行任何编辑。

我的问题是:

运行 npm run watch/dev 甚至 npm run production 后,vendor.js 大约有 26MB,我觉得这太大了。

  • 我尝试运行 npm run report 但没有显示任何内容,没有错误或数据。
  • Webpack 捆绑分析器插件已配置,但 stats.json 为空。

以下是 package.json 的依赖项:

  "husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"resources/**/*.{js,vue}": [
"eslint --fix",
"git add"
]
},
"devDependencies": {
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
"babel-eslint": "^10.0.2",
"babel-plugin-dynamic-import-node": "^2.3.0",
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"babel-plugin-syntax-jsx": "^6.18.0",
"babel-plugin-transform-vue-jsx": "^3.7.0",
"compression-webpack-plugin": "^2.0.0",
"cross-env": "^3.2.3",
"eslint": "^5.16.0",
"eslint-loader": "^2.2.1",
"eslint-plugin-vue": "^5.2.3",
"husky": "^3.0.2",
"laravel-mix": "^4.1.2",
"laravel-mix-eslint": "^0.1.3",
"lint-staged": "^9.2.1",
"resolve-url-loader": "^2.3.1",
"sass-loader": "^7.1.0",
"script-loader": "^0.7.2",
"svg-sprite-loader": "^4.1.3",
"vue-template-compiler": "2.6.10",
"webpack": "^4.39.1",
"webpack-bundle-analyzer": "^3.4.1"
},
"dependencies": {
"axios": "^0.18.1",
"camelcase": "^5.3.1",
"clipboard": "^2.0.4",
"core-js": "^3.1.4",
"driver.js": "^0.9.7",
"dropzone": "^5.5.1",
"echarts": "^4.1.0",
"element-ui": "^2.11.1",
"file-saver": "^2.0.1",
"fuse.js": "^3.4.5",
"js-cookie": "^2.2.0",
"jsonlint": "^1.6.3",
"jszip": "^3.2.2",
"node-sass": "^4.12.0",
"normalize.css": "^8.0.1",
"nprogress": "^0.2.0",
"path-to-regexp": "^3.0.0",
"screenfull": "^4.2.1",
"sortablejs": "^1.8.4",
"tui-editor": "^1.4.5",
"vue": "2.6.10",
"vue-count-to": "^1.0.13",
"vue-i18n": "^8.12.0",
"vue-router": "^3.0.7",
"vue-splitpane": "^1.0.4",
"vuedraggable": "^2.23.0",
"vuex": "3.1.0",
"xlsx": "^0.14.4"
}

在laravue官方演示中https://laravue.dev/ ,vendor.js 约为 4MB。

我找不到此问题的任何原因,有人可以提供任何建议吗?

最佳答案

已解决

经过几个小时的检查,我发现“npm run production ”由于内存不足而没有完成,这就是为什么没有返回错误,该进程在某个时候被杀死,没有任何消息。

只需重新启动服务器并重新运行命令..就像魔术一样工作。

关于node.js - npm 运行生产后,vendor.js 很大,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57364325/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com