-
Notifications
You must be signed in to change notification settings - Fork 20
/
webpack.config.js
43 lines (41 loc) · 1.23 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
const path = require('path');
const webpack = require('webpack');
const jf = require('jsonfile');
const pkg = jf.readFileSync('./package.json');
const LicenseWebpackPlugin = require('license-webpack-plugin').LicenseWebpackPlugin;
const banner = `/*! ${pkg.name} - v${pkg.version} */`;
module.exports = {
mode: 'production',
stats: {
colors: true,
modules: true,
reasons: true,
},
entry: './dist/cjs/src/index.js',
output: {
path: path.resolve(__dirname, './dist/cjs'),
filename: 'index.js',
library: 'soqlParserJs',
libraryTarget: 'umd',
umdNamedDefine: true,
// https://github.com/webpack/webpack/issues/6784#issuecomment-375941431
globalObject: "typeof self !== 'undefined' ? self : this",
},
optimization: {
minimize: true,
},
module: {
rules: [
// This rule ensures the validation checks are disabled for production build to improve startup performance
{
test: /parser|lexer\.js$/,
loader: 'string-replace-loader',
options: {
search: 'skipValidations: false',
replace: 'skipValidations: true',
},
},
],
},
plugins: [new webpack.BannerPlugin({ banner: banner, raw: true }), new LicenseWebpackPlugin()],
};