我將基於React Slingshot樣板的編譯節點站點部署到Github頁面。通過npm start可以在本地運行。如何調試404發佈節點站點到Github頁面?
但是,當我使用babel編譯文件並提交到我的github頁面庫。該網站爲main.c5ec540e041525c6d312.js
文件返回了404,儘管我可以看到它位於git存儲庫中。 (從鏈接致力於公司名稱等等,這些將不低於工作)
從GitHub創建的鏈接是:
https://pages.github.mycompanyname.com/DDM/index.html
而404我得到的是:
https://pages.github.mycompanyname.com/main.c5ec540e041525c6d312.js/
我嘗試刪除並重新添加回購建議這裏無濟於事:
How to fix page 404 on Github Page?
問: 如何調試404發佈節點網站Github的頁面?
這是babel編譯後dist文件夾的內容。然後我把它推到了Github Pages repo上,它可以從主分支自動構建網站。但給人的main.js文件404:
我曾嘗試編譯之前也改變Index.js的browserHistory
到hashHistory
。作爲在GitHub上的網頁問題指出browserHistory使用絕對鏈接,而後者則沒有:
import React from 'react';
import ReactDom from 'react-dom';
import Routes from './routes';
import {Router, hashHistory} from 'react-router';
import './styles/styles.scss';
import appStore from './reducers';
import { Provider } from 'react-redux';
import { createStore } from 'redux';
let store = createStore(appStore);
require('./images/favicon.ico');
let element = document.getElementById('app');
ReactDom.render(
<Provider store={store}>
<Router history={hashHistory} routes={Routes.routes} />
</Provider>, element);
document.body.classList.remove('loading');
這是編譯index.js文件的鏈接:
http://hastebin.com/sipimizazu.xml
也要看webpack專業版配置編譯。我看到公共路徑設置如下:
export default {
resolve: {
extensions: ['', '.js', '.jsx']
},
debug: true,
devtool: 'source-map', // more info:https://webpack.github.io/docs/build-performance.html#sourcemaps and https://webpack.github.io/docs/configuration.html#devtool
noInfo: true, // set to false to see a list of every file being bundled.
entry: path.resolve(__dirname, 'src/index'),
target: 'web', // necessary per https://webpack.github.io/docs/testing.html#compile-and-test
output: {
path: path.resolve(__dirname, 'dist'),
publicPath: '/',
filename: '[name].[chunkhash].js'
},
你把它放在GH-頁面分支? –
不,它是在主人和頁面生成器被設置爲從中拉。 –
你確定該文件簽入git? –