为了账号安全,请及时绑定邮箱和手机立即绑定

react 关于 webpack 打包

react 关于 webpack 打包

素胚勾勒不出你 2019-04-19 16:29:34
"scripts":{"start":"webpack-dev-server--content-basepublic/","stage":"NODE_ENV=stagingwebpack-p--config--progress","deploy":"NODE_ENV=productionwebpack-p--config--progress","debug":"NODE_ENV=debugwebpack-dev-server--content-basepublic/"},正常npmstart可以跑起来了可运行npmrundeploy就报错了$npmrundeploy>react-scaffold@1.0.0deployE:\zan\www\webpack\react-scaffold>NODE_ENV=productionwebpack-p--config--progress'NODE_ENV'▒▒▒▒▒ڲ▒▒▒▒ⲿ▒▒▒Ҳ▒▒▒ǿ▒▒▒▒еij▒▒▒▒▒▒▒▒▒▒▒▒ļ▒▒▒npmERR!Windows_NT6.1.7601npmERR!argv"D:\\nodejs\\node.exe""D:\\nodejs\\node_modules\\npm\\bin\\npm-cli.js""run""deploy"npmERR!nodev4.0.0npmERR!npmv2.14.2npmERR!codeELIFECYCLEnpmERR!react-scaffold@1.0.0deploy:`NODE_ENV=productionwebpack-p--config--progress`npmERR!Exitstatus1npmERR!npmERR!Failedatthereact-scaffold@1.0.0deployscript'NODE_ENV=productionwebpack-p--config--progress'.npmERR!Thisismostlikelyaproblemwiththereact-scaffoldpackage,npmERR!notwithnpmitself.npmERR!Telltheauthorthatthisfailsonyoursystem:npmERR!NODE_ENV=productionwebpack-p--config--progressnpmERR!Youcangettheirinfovia:npmERR!npmownerlsreact-scaffoldnpmERR!Thereislikelyadditionalloggingoutputabove.npmERR!Pleaseincludethefollowingfilewithanysupportrequest:npmERR!E:\zan\www\webpack\react-scaffold\npm-debug.log而直接运行webpack-p正常哪里写错了吗求大神指导一下呀
查看完整描述

2 回答

?
芜湖不芜

TA贡献1796条经验 获得超7个赞

NODE_ENV=production
是linux设置变量的方法,windows需要用set
setNODE_ENV=production&&webpack-p--config--progress
                            
查看完整回答
反对 回复 2019-04-19
?
holdtom

TA贡献1805条经验 获得超10个赞

1.你得有webpack.production.js文件
2.执行webpack--configwebpack.production.js
                            
查看完整回答
反对 回复 2019-04-19
  • 2 回答
  • 0 关注
  • 530 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信