forked from nextapps-de/flexsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.node.js
62 lines (60 loc) · 1.51 KB
/
webpack.node.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
52
53
54
55
56
57
58
59
60
61
const Path = require('path');
const webpack = require('webpack');
const nodeExternals = require('webpack-node-externals');
module.exports = (env) => {
return {
entry: {
app: Path.resolve(__dirname, './src/node.js'),
},
output: {
path: Path.join(__dirname, './dist'),
filename: 'flexsearch.node.js',
libraryTarget: 'commonjs',
},
target: 'node',
devtool: env.production ? undefined : "inline-source-map",
mode: env.production ? "production" : "development",
externals: [nodeExternals()],
optimization: {
splitChunks: {
chunks: 'all',
name: false,
},
},
plugins: [
new webpack.DefinePlugin({
RELEASE: "node",
DEBUG: false,
PROFILER: false,
POLYFILL: true,
SUPPORT_WORKER: false,
SUPPORT_ENCODER: true,
SUPPORT_CACHE: true,
SUPPORT_ASYNC: true,
SUPPORT_PRESET: true,
SUPPORT_SUGGESTION: true,
SUPPORT_SERIALIZE: true,
SUPPORT_INFO: true,
SUPPORT_DOCUMENT: true,
SUPPORT_WHERE: true,
SUPPORT_PAGINATION: true,
SUPPORT_OPERATOR: true,
SUPPORT_CALLBACK: true,
SUPPORT_LANG: true,
}),
new webpack.IgnorePlugin(/config\.js|bundle\.js|export\.js/)
],
module: {
rules: [
{
test: /\.(tsx?)|\.(js)$/,
exclude: /(node_modules)/,
use: {
loader: 'babel-loader',
options: {}
}
},
],
},
}
};