0
的問題是,當我添加一個鏈接組成例如化妝組成鏈接
<Route path="L1/L2" component={Comp}/>
導航到該鏈接時,應用程序無法加載從公用文件夾的資源導致應用程序是從例如加載資源:http://localhost:8080/L1/bundle.js
代替http://localhost:8080/bundle.js
我想這是在的WebPack配置有問題,但不能在這裏解決它 是我的WebPack配置:
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
}
所有幫助將不勝感激提前謝謝!
謝謝你工作:) – abderrahmen