i've built a react app in ES6 and created a bundle.js
and anchored it in an HTML page served by django. The app worked fine during development running on the node server, but when the page is served by django linking to the static bundle.js
file, i got the following error:
VM1517:1 Uncaught Error: Cannot find module "./src/index.js"
note that index.js
is the entry point of this react app. any help is appreciated! thanks!
the webpack.config.js
is below:
module.exports = {
entry: [
'./src/index.js'
],
output: {
path: __dirname,
publicPath: '/',
filename: 'bundle.js'
},
module: {
loaders: [{
exclude: /node_modules/,
loader: 'babel'
}]
},
resolve: {
extensions: ['', '.js', '.jsx']
},
devServer: {
contentBase: './'
}
};
via totoro
No comments:
Post a Comment