Skip to content

Commit 8010fed

Browse files
committed
Use publicPath option instead of custom baseHref
1 parent b61f9f2 commit 8010fed

File tree

3 files changed

+5
-18
lines changed

3 files changed

+5
-18
lines changed

website/index.html.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="utf-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<title>React Router: Declarative Routing for React.js</title>
7-
<base href="<%= htmlWebpackPlugin.options.baseHref %>"/>
7+
<base href="<%= webpackConfig.output.publicPath %>"/>
88
<style>
99
html, body, #app { height: 100%; margin: 0 }
1010
*, *:before, *:after { box-sizing: border-box; }

website/package.json

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11
{
2-
"name": "react-router-website",
3-
"version": "0.0.0",
42
"private": true,
53
"scripts": {
6-
"dev": "webpack-dev-server --inline",
7-
"build": "npm run clean && webpack -p",
8-
"clean": "rm -rf build",
9-
"start": "npm run build && pushstate-server build/"
10-
},
11-
"dependencies": {
12-
"pushstate-server": "1.14.0"
4+
"build": "webpack -p",
5+
"start": "webpack-dev-server --inline"
136
},
147
"devDependencies": {
158
"bundle-loader": "0.5.4",
@@ -20,7 +13,6 @@
2013
"markdown-it": "^7.0.0",
2114
"postcss-loader": "0.9.1",
2215
"prismjs-loader": "0.0.3",
23-
"pushstate-server": "^1.14.0",
2416
"react-motion": "^0.4.4",
2517
"style-loader": "0.13.1",
2618
"url-loader": "^0.5.7",

website/webpack.config.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1+
const path = require('path')
12
const webpack = require('webpack')
23
const HTMLWebpackPlugin = require('html-webpack-plugin')
3-
const path = require('path')
44

55
const HASH = '[chunkHash]'
6-
const PROD = process.env.NODE_ENV === 'production'
7-
86
const ROUTER_SRC = path.join(__dirname, '..', 'modules')
97

108
module.exports = {
11-
129
devtool: 'source-map',
1310

1411
entry: {
@@ -19,14 +16,12 @@ module.exports = {
1916
output: {
2017
path: path.join(__dirname, 'build'),
2118
filename: `bundle-${HASH}.js`,
22-
chunkFileName: `[name]-${HASH}.js`,
23-
pubicPath: PROD ? 'build/' : ''
19+
chunkFileName: `[name]-${HASH}.js`
2420
},
2521

2622
plugins: [
2723
new webpack.optimize.CommonsChunkPlugin('vendor', `vendor-${HASH}.js`),
2824
new HTMLWebpackPlugin({
29-
baseHref: PROD ? '//reacttraining.github.io/react-router/' : '/',
3025
template: 'index.html.ejs'
3126
})
3227
],

0 commit comments

Comments
 (0)