-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathwebpack.config.babel.js
56 lines (55 loc) · 1.3 KB
/
webpack.config.babel.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
const path = require('path');
const webpack = require('webpack');
module.exports = {
entry: [
'react-hot-loader/patch',
'webpack-dev-server/client?http://localhost:8080/', // WebpackDevServer host and port
'webpack/hot/only-dev-server', // "only" prevents reload on syntax errors
'./src/main.jsx',
],
output: {
path: path.join(__dirname, 'dist'),
publicPath: '/dist/',
filename: 'bundle.js',
chunkFilename: '[id].bundle.js',
library: 'app/bundle',
libraryTarget: 'amd',
},
resolve: {
modules: [path.resolve(__dirname, '/src'), 'node_modules/'],
descriptionFiles: ['package.json'],
extensions: ['.js', '.jsx'],
},
externals: /^esri/,
devtool: '#inline-source-map',
devServer: {
inline: true,
port: 8080,
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NamedModulesPlugin(),
],
module: {
loaders: [
{
enforce: 'pre',
test: /\.jsx?$/,
loader: 'eslint-loader',
exclude: /node_modules/,
},
{
test: /\.css$/,
loaders: ['style-loader', 'css-loader'],
},
{
test: /\.jsx?$/,
loader: 'babel-loader',
exclude: /node_modules/,
query: {
presets: ['es2015', 'react'],
},
},
],
},
};