Add publicpath=/frame/

This commit is contained in:
Abhas Bhattacharya
2019-02-28 13:13:39 +05:30
parent 899ed90ff1
commit cc5b31665a
3 changed files with 19 additions and 6 deletions
+13
View File
@@ -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;
}
};
+3 -3
View File
@@ -22,9 +22,9 @@ export default class App extends Component {
<div id="app">
<Header />
<Router onChange={this.handleRoute}>
<Home path="/" />
<Profile path="/profile/" user="me" />
<Profile path="/profile/:user" />
<Home path="/frame/" />
<Profile path="/frame/profile/" user="me" />
<Profile path="/frame/profile/:user" />
</Router>
</div>
);
+3 -3
View File
@@ -6,9 +6,9 @@ const Header = () => (
<header class={style.header}>
<h1>Preact App</h1>
<nav>
<Link activeClassName={style.active} href="/">Home</Link>
<Link activeClassName={style.active} href="/profile">Me</Link>
<Link activeClassName={style.active} href="/profile/john">John</Link>
<Link activeClassName={style.active} href="/frame/">Home</Link>
<Link activeClassName={style.active} href="/frame/profile">Me</Link>
<Link activeClassName={style.active} href="/frame/profile/john">John</Link>
</nav>
</header>
);