forked from graphql-kit/graphql-voyager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
52 lines (48 loc) · 1.14 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
49
50
51
52
const webpack = require('webpack');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const root = require('../../build/helpers').root;
module.exports = {
devtool: 'cheap-source-map',
performance: {
hints: false
},
devServer: {
contentBase: root('example/webpack-example/'),
watchContentBase: true,
port: 9090,
stats: 'errors-only'
},
resolve: {
extensions: ['.ts', '.tsx', '.mjs', '.js', '.json', '.css', '.svg'],
alias: { // fix "duplicated react" issue when using npm link
'react': require.resolve('react'),
}
},
entry: ['./index.jsx'],
output: {
path: root('example/webpack-example/dist'),
filename: 'main.js',
sourceMapFilename: '[file].map'
},
module: {
rules: [
{
test: /.jsx?$/,
loader: 'babel-loader',
exclude: /node_modules/,
options: {
presets: ['@babel/env', '@babel/react']
}
}
]
},
plugins: [
new webpack.LoaderOptionsPlugin({
minimize: true,
debug: false
}),
new CopyWebpackPlugin([
{ from: './node_modules/graphql-voyager/dist/voyager.worker.js' }
])
]
}