-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
51 lines (49 loc) · 1.13 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
// webpack v4
const webpack = require('webpack')
const path = require('path');
module.exports = {
entry: {
main: ['babel-polyfill', './src/index.js'],
},
module: {
rules: [
// {
// test: /\.(js)$/,
// exclude: /node_modules/,
// use: ['babel-loader']
// },
{
test: /\.(js)$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: [
// Use the latest version of ECMAScript
[
'@babel/preset-env',
{ targets: 'last 2 versions' },
],
// Use the React preset for JSX support
'@babel/preset-react',
],
},
},
},
{
test: /\.(md)$/,
loader: 'ignore-loader',
},
]
},
// ignore nodejs modules that are not being used to avoid not found error
plugins: [
new webpack.IgnorePlugin(/abort-controller/),
new webpack.IgnorePlugin(/form-data/),
new webpack.IgnorePlugin(/nano/), // CouchDB Client
new webpack.IgnorePlugin(/node-localstorage/),
new webpack.IgnorePlugin(/node-fetch/),
new webpack.IgnorePlugin(/\@polkadot\/util-crypto/),
new webpack.IgnorePlugin(/\@polkadot\/util/),
],
}