forked from XiaoningLiu/autorest.typescript.server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.ts
57 lines (55 loc) · 1.38 KB
/
webpack.config.ts
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
import * as webpack from 'webpack';
import * as glob from 'glob';
import * as path from 'path';
import ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
const config: webpack.Configuration = {
entry: glob.sync('test/*/*.ts', { absolute: true }),
devtool: 'source-map',
mode: 'development',
output: {
filename: 'testBundle.js',
path: __dirname
},
plugins: process.env.CI ? [] : [
new ForkTsCheckerWebpackPlugin()
],
devServer: {
contentBase: './'
},
module: {
rules: [
{
test: /\.tsx?$/,
loader: 'ts-loader',
options: {
// speed up build times and get type checking through the forked checker plugin
transpileOnly: !process.env.CI
}
}
]
},
// TODO: setup which ensures that the bundle we ship out of ms-rest[-azure]-js works in the browser
// Downside: more individual watches are required to make this responsive to your edits
// externals: {
// "@azure/ms-rest-js": "msRest",
// "@azure/ms-rest-azure-js": "msRestAzure"
// },
resolve: {
extensions: [".tsx", ".ts", ".js"],
alias: {
"moment": path.resolve('./node_modules/moment/min/moment.min.js')
}
},
node: {
fs: "empty",
net: false,
path: false,
dns: false,
tls: false,
tty: false,
v8: false,
Buffer: false,
process: true
}
};
export = config;