-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathwebpack.prod.config.js
More file actions
61 lines (60 loc) · 1.74 KB
/
Copy pathwebpack.prod.config.js
File metadata and controls
61 lines (60 loc) · 1.74 KB
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 CopyPlugin = require('copy-webpack-plugin');
module.exports = {
target : 'node',
mode : 'development',
entry : './index.js',
output : {
filename: 'index.dist.js',
path : path.resolve(__dirname, './dist')
},
devtool: 'inline-source-map',
watch : false,
resolve: {
alias: {
[path.join(__dirname, 'node_modules/sqlite3/lib/sqlite3-binding.js')]: path.join(__dirname, 'database/sqlite3/sqlite3-binding.js')
}
},
module : {
rules: [
{
test : /\.m?js$/,
exclude: /node_modules/,
use : {
loader : 'babel-loader',
options: {
presets : [
'@babel/preset-env'
],
plugins : [
[
'@babel/plugin-transform-runtime',
{
'regenerator': true
}
]
],
sourceMaps : 'inline',
retainLines: true
}
},
resolve: {
extensions: [
'.js',
'.mjs'
]
}
}
]
},
plugins: [
new CopyPlugin({
patterns: [
{
from: 'node_modules/sqlite3/build/**/node_sqlite3.node',
to : 'build/node_sqlite3.node'
}
]
})
]
};