UNPKG

1.15 kBJavaScriptView Raw
1var webpack = require('webpack');
2
3module.exports = {
4 entry: {
5 app: [
6 './app.jsx',
7 'webpack-dev-server/client?http://localhost:3000',
8 'webpack/hot/dev-server'
9 ]
10 },
11 output: {
12 filename: 'app.js',
13 path: __dirname + '/out',
14 publicPath: '/out'
15 },
16 devtool: 'source-map',
17 plugins: [
18 new webpack.HotModuleReplacementPlugin()
19 ],
20 resolve: {
21 // Allow to omit extensions when requiring these files
22 extensions: ['', '.js', '.jsx']
23 },
24 resolveLoader: {
25 // This is a bit nutty, but we set resolveLoader.root to the parent of
26 // the entire jsxlate-loader directory, so it resolves
27 // jsxlate-loader/index.js as the loader, allowing us to depend on the
28 // module itself instead of npm inception
29 root: __dirname + '/../../..'
30 },
31 module: {
32 loaders: [
33 { test: /\.js$/, exclude: /node_modules/, loaders: ['babel'] },
34 // Pass *.jsx files through jsx-loader transform
35 { test: /\.jsx$/, loaders: ['react-hot', 'babel'] },
36 ]
37 }
38}