I am new to webpack, I am facing few problems while trying to setup webpack.
I have the following directory structure:
- Node Modules
- Public (index.html, index.jsx)
- Components
- webpack.config.js
In index.html I have tried to include
<script src="../node_modules/react/dist/react-with-addons.js"></script>
and when I am trying to run webpack dev server console is showing me
http://localhost:8080/node_modules/react/dist/react-with-addons.js not found
The following is my webpack.config.js file:
module.exports = {
//This is the entry point for the webpack
entry: {
app: ['./public/index.jsx']
},
output: {
// This is the name of the bundle which is created when webpack runs
path: './public',
filename: 'bundle.js'
},
module: {
loaders: [
{
//tell webpack to use jsx-loader for all *.jsx files
test: /\.jsx$/,
loader: 'jsx-loader?insertPragma=React.DOM&harmony'
}
]
},
resolve: {
extensions: ['', '.js', '.jsx']
}
}