reactjs - make composed Link with react-router -
the problem when add composed link example
<route path="l1/l2" component={comp}/>
when navigating link app can't load resources public folder cause app loading resources example : http://localhost:8080/l1/bundle.js
instead of http://localhost:8080/bundle.js
guess it's problem in webpack configuration couldn't fix here webpack config :
var config = { devtool: 'eval-source-map', entry: __dirname + "/app/index.js", output: { path: __dirname + "/public", filename: "bundle.js" }, module: { loaders: [{ test: /\.jsx?$/, exclude: /node_modules/, loader: 'babel', query: { presets: ['es2015','react'] } }] }, devserver: { contentbase: "./public", colors: true, historyapifallback: true, inline: true }
all appreciated thank in advance !
it's how load in bundle in index.html
:
<script src="bundle.js"></script>
relative current url.<script src="/bundle.js"></script>
relative root.
try second version, should work then.
Comments
Post a Comment