-
Notifications
You must be signed in to change notification settings - Fork 13
/
webpack.config.js
35 lines (33 loc) 路 824 Bytes
/
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
const path = require('path');
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
const mode = process.env.MODE;
module.exports = {
mode,
target: 'node',
entry: path.resolve(__dirname, './src/index.js'),
output: {
path: path.resolve(__dirname, './dist'),
filename: 'crypto-portfolio-viwer.bundle.js',
libraryTarget: 'umd',
globalObject: 'this',
},
resolve: {
// our code can resolve 'xxx' instead of writing 'xxx.jsx'
extensions: ['*', '.js'],
},
module: {
// For every file that match regex in 'test', webpack pipes the code through to loaders
rules: [
{
test: /\.(js)$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
},
},
],
},
plugins: [
// new BundleAnalyzerPlugin(),
],
};