forked from APIs-guru/graphql-voyager
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
53 lines (49 loc) · 1.11 KB
/
webpack.config.js
File metadata and controls
53 lines (49 loc) · 1.11 KB
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
const path = require('node:path');
const webpack = require('webpack');
const CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
devtool: 'cheap-source-map',
performance: {
hints: false,
},
devServer: {
contentBase: __dirname,
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: path.resolve(__dirname, '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' },
]),
],
};