forked from mariusandra/pigeon-maps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
48 lines (44 loc) · 1.12 KB
/
webpack.config.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
const webpack = require('webpack')
const path = require('path')
const nodeEnv = process.env.NODE_ENV || 'development'
const isProd = nodeEnv === 'production'
var config = {
devtool: isProd ? 'hidden-source-map' : 'cheap-eval-source-map',
context: path.join(__dirname, './demo'),
entry: {
vendor: ['react', 'react-dom'],
demo: isProd ? ['./index.tsx'] : ['webpack-dev-server/client?http://0.0.0.0:4040', './index.tsx'],
},
output: {
path: path.join(__dirname, './docs'),
publicPath: '',
chunkFilename: '[name].bundle.js',
filename: '[name].bundle.js',
},
module: {
rules: [
{
test: /\.(html|png|jpg|gif|jpeg|svg)$/,
loader: 'file-loader',
query: {
name: '[name].[ext]',
},
},
{
test: /\.(js|jsx|ts|tsx)$/,
exclude: /node_modules/,
loaders: ['babel-loader'],
},
],
},
resolve: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
modules: [path.resolve('./demo'), 'node_modules']
},
plugins: [],
devServer: {
contentBase: './demo',
disableHostCheck: true,
},
}
module.exports = config