forked from polkadot-js/ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
51 lines (49 loc) · 1.43 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
// Copyright 2017-2020 @polkadot/example-react authors & contributors
// SPDX-License-Identifier: Apache-2.0
const path = require('path');
const { WebpackPluginServe } = require('webpack-plugin-serve');
module.exports = {
context: __dirname,
devtool: 'cheap-eval-source-map',
entry: './src/index.tsx',
mode: 'development',
module: {
rules: [
{
exclude: /(node_modules)/,
test: /\.(ts|tsx)$/,
use: [
{
loader: 'babel-loader',
options: require('../../babel.config.js')
}
]
}
]
},
output: {
chunkFilename: '[name].[chunkhash:8].js',
filename: '[name].js',
globalObject: '(typeof self !== \'undefined\' ? self : this)',
path: path.join(__dirname, 'build')
},
plugins: [
new WebpackPluginServe({
hmr: false, // switch off, Chrome WASM memory leak
liveReload: false, // explict off, overrides hmr
port: 8080,
progress: false, // since we have hmr off, disable
static: __dirname
})
],
resolve: {
alias: {
'@polkadot/react-identicon': path.resolve(__dirname, '../react-identicon/build'),
'@polkadot/ui-keyring': path.resolve(__dirname, '../ui-keyring/build'),
'@polkadot/ui-settings': path.resolve(__dirname, '../ui-settings/build'),
'@polkadot/ui-shared': path.resolve(__dirname, '../ui-shared/build')
},
extensions: ['.js', '.ts', '.tsx']
},
watch: true
};