[英]React Redux 'npm run deploy' app not working
嘗試部署簡單的react + redux應用程序時遇到一些問題。
我正在使用React Redux入門套件
當運行在開發應用程序npm run dev:nw
都好, this.props.startTimer()
函數componentWillMount()
火災,並在模塊中的時間間隔更新狀態。 一切正常。
當我使用npm run deploy
部署應用程序時,我沒有任何錯誤,並且一切似乎都可以正常工作。
app:config Create configuration. +0ms
app:config Apply environment overrides for NODE_ENV "production". +3ms
app:webpack:config Create configuration. +839ms
app:webpack:config Enable plugins for production (OccurenceOrder, Dedupe & UglifyJS). +2ms
app:webpack:config Apply ExtractTextPlugin to CSS loaders. +69ms
app:bin:compile Run compiler +4ms
app:build:webpack-compiler Webpack compile completed. +14s
app:build:webpack-compiler Hash: ce8ff073e185128cb7b1
Version: webpack 1.12.9
Time: 13543ms
大量的react / babel / redux構建消息如下。 最終輸出以
app:build:webpack-compiler No errors or warnings encountered. +2ms
app:bin:compile Copy static assets to dist folder. +0ms
我導航到http:// domain / dist ,頁面顯示出與dev一樣的外觀,但是this.props.startTimer()不會觸發,因為它在開發中效果很好,沒有任何反應。 腳本在那里,一切看起來都很好,但是什么也沒發生。
是什么原因造成的?
我嘗試將NODE_ENV設置為基礎,開發和生產。 沒有變化。
需要幫助
問題是配置錯誤的nginx無法正確處理dist /文件夾。 將內容移至文檔根目錄並成功。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.