1 | const path = require('path');
|
2 | const webpack = require('webpack');
|
3 |
|
4 | module.exports = {
|
5 |
|
6 | entry: ['babel-polyfill', './lib/index.ts'],
|
7 |
|
8 | output: {
|
9 | path: path.resolve(__dirname + '/dist'),
|
10 | filename: 'suman.js'
|
11 | },
|
12 |
|
13 | plugins: [
|
14 | new webpack.WatchIgnorePlugin([
|
15 | /\.js$/,
|
16 | /\.d\.ts$/
|
17 | ])
|
18 | ],
|
19 |
|
20 | module: {
|
21 |
|
22 | rules: [
|
23 |
|
24 | {
|
25 | test: /\.ts$/,
|
26 | loader: 'ts-loader'
|
27 | },
|
28 | {
|
29 | test: /^\.d.ts$/,
|
30 | loader: 'ignore-loader'
|
31 | },
|
32 | {
|
33 | test: new RegExp('^' + path.resolve(__dirname + '/lib/cli-commands/') + '.*'),
|
34 | loader: 'ignore-loader'
|
35 | },
|
36 | {
|
37 | test: new RegExp('^' + path.resolve(__dirname + '/suman.conf.js')),
|
38 | loader: 'ignore-loader'
|
39 | }
|
40 | ],
|
41 |
|
42 | },
|
43 |
|
44 | resolve: {
|
45 | alias: {
|
46 | fs: require.resolve('suman-browser-polyfills/modules/fs'),
|
47 | process: require.resolve('suman-browser-polyfills/modules/process'),
|
48 | },
|
49 |
|
50 | extensions: ['.ts', '.js']
|
51 | },
|
52 |
|
53 | node: {
|
54 | assert: true,
|
55 | buffer: false,
|
56 | child_process: 'empty',
|
57 | cluster: 'empty',
|
58 | console: false,
|
59 | constants: true,
|
60 | crypto: 'empty',
|
61 | dgram: 'empty',
|
62 | dns: 'mock',
|
63 | domain: true,
|
64 | events: true,
|
65 |
|
66 | http: true,
|
67 | https: true,
|
68 | module: 'empty',
|
69 | net: 'mock',
|
70 | os: true,
|
71 | path: true,
|
72 | process: false,
|
73 | punycode: true,
|
74 | querystring: true,
|
75 | readline: 'empty',
|
76 | repl: 'empty',
|
77 | stream: true,
|
78 | string_decoder: true,
|
79 | timers: true,
|
80 | tls: 'mock',
|
81 | tty: true,
|
82 | url: true,
|
83 | util: true,
|
84 | v8: 'mock',
|
85 | vm: true,
|
86 | zlib: 'empty',
|
87 | }
|
88 | };
|