-
Notifications
You must be signed in to change notification settings - Fork 13
/
webpack.config.js
50 lines (43 loc) · 1.09 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
const path = require('path');
const pkg = require('./package.json');
const SRC_DIR = './src';
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin');
const NodeExternals = require('webpack-node-externals');
const { symlink } = require('fs');
let config = {
devtool: 'eval-source-map',
// entry point - src/index.js
entry: path.join(__dirname, SRC_DIR, 'index.js'),
// webpack throws warning if not provided a default mode
// use the 'build:dev' script if you want development mode with non-minified file
// this mode is used in 'build' script
mode: 'development',
output: {
path: path.join( __dirname ),
filename: pkg.name + '.js',
library: pkg.name,
libraryTarget: 'umd',
},
// loader
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: 'babel-loader'
}
]
},
// minimize file if mode is production
optimization: {
minimize: false
},
plugins: [
new NodePolyfillPlugin(),
],
externals: [NodeExternals()],
resolve:{
symlinks:false,
}
};
module.exports = config;