-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathwebpack.config.js
More file actions
60 lines (58 loc) 路 1.29 KB
/
Copy pathwebpack.config.js
File metadata and controls
60 lines (58 loc) 路 1.29 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
import webpack from 'webpack';
import UglifyJSPlugin from 'uglifyjs-webpack-plugin';
import { resolve as resolvePath } from 'path';
const dir = {
src: resolvePath(__dirname, './src'),
dist: resolvePath(__dirname, './dist'),
};
export default {
context: dir.src,
entry: dir.src,
output: {
path: dir.dist,
filename: 'index.js',
libraryTarget: 'commonjs2',
},
module: {
rules: [
{
test: /\.js$/,
include: dir.src,
use: [
{
loader: 'babel-loader',
options: {
babelrc: false,
presets: [
[
'env',
{
modules: false,
targets: {
node: 4,
},
},
],
'stage-0',
'babili',
],
},
},
],
},
],
},
externals: ['../build/Release/fonttools.node'],
plugins: [
new webpack.optimize.LimitChunkCountPlugin({ maxChunks: 1 }),
new webpack.BannerPlugin({
banner: 'require("source-map-support").install();',
options: { raw: true, entryOnly: false },
}),
new UglifyJSPlugin(),
],
target: 'node',
node: {
__dirname: false,
},
};