mirror of
https://github.com/bendtherules/preact-publicpath-bug.git
synced 2026-08-18 13:52:50 +00:00
Add publicpath=/frame/
This commit is contained in:
@@ -0,0 +1,13 @@
|
|||||||
|
import webpack from 'webpack';
|
||||||
|
|
||||||
|
const publicPath = '/frame/';
|
||||||
|
|
||||||
|
export default (config, env, helpers) => {
|
||||||
|
config.output.publicPath = publicPath;
|
||||||
|
|
||||||
|
if (env.production) {
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
config.devServer.publicPath = publicPath;
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -22,9 +22,9 @@ export default class App extends Component {
|
|||||||
<div id="app">
|
<div id="app">
|
||||||
<Header />
|
<Header />
|
||||||
<Router onChange={this.handleRoute}>
|
<Router onChange={this.handleRoute}>
|
||||||
<Home path="/" />
|
<Home path="/frame/" />
|
||||||
<Profile path="/profile/" user="me" />
|
<Profile path="/frame/profile/" user="me" />
|
||||||
<Profile path="/profile/:user" />
|
<Profile path="/frame/profile/:user" />
|
||||||
</Router>
|
</Router>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ const Header = () => (
|
|||||||
<header class={style.header}>
|
<header class={style.header}>
|
||||||
<h1>Preact App</h1>
|
<h1>Preact App</h1>
|
||||||
<nav>
|
<nav>
|
||||||
<Link activeClassName={style.active} href="/">Home</Link>
|
<Link activeClassName={style.active} href="/frame/">Home</Link>
|
||||||
<Link activeClassName={style.active} href="/profile">Me</Link>
|
<Link activeClassName={style.active} href="/frame/profile">Me</Link>
|
||||||
<Link activeClassName={style.active} href="/profile/john">John</Link>
|
<Link activeClassName={style.active} href="/frame/profile/john">John</Link>
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user