2018-10-26 23:59:05 +03:00
|
|
|
import * as webpack from "webpack";
|
|
|
|
import * as glob from "glob";
|
|
|
|
import * as path from "path";
|
2018-04-18 00:36:24 +03:00
|
|
|
|
2018-05-10 21:20:38 +03:00
|
|
|
const config: webpack.Configuration = {
|
2019-01-25 20:22:30 +03:00
|
|
|
entry: glob.sync(path.join(__dirname, "test/**/*[^node\.].ts")),
|
2018-10-26 23:59:05 +03:00
|
|
|
mode: "development",
|
|
|
|
devtool: "source-map",
|
2019-01-22 22:46:55 +03:00
|
|
|
stats: {
|
|
|
|
colors: true,
|
|
|
|
hash: false,
|
|
|
|
version: false,
|
|
|
|
timings: false,
|
|
|
|
assets: false,
|
|
|
|
chunks: false,
|
|
|
|
modules: false,
|
|
|
|
reasons: false,
|
|
|
|
children: false,
|
|
|
|
source: false,
|
|
|
|
errors: true,
|
|
|
|
errorDetails: false,
|
|
|
|
warnings: false,
|
|
|
|
publicPath: false
|
|
|
|
},
|
2018-04-18 00:36:24 +03:00
|
|
|
output: {
|
2019-01-16 02:00:06 +03:00
|
|
|
filename: "msRest.browser.test.js",
|
|
|
|
path: path.resolve(__dirname, "test")
|
2018-04-18 00:36:24 +03:00
|
|
|
},
|
2018-06-22 20:17:31 +03:00
|
|
|
plugins: [
|
2018-06-23 00:38:37 +03:00
|
|
|
new webpack.NormalModuleReplacementPlugin(/(\.).+util\/base64/, path.resolve(__dirname, "./lib/util/base64.browser.ts")),
|
2018-08-23 00:46:25 +03:00
|
|
|
new webpack.NormalModuleReplacementPlugin(/(\.).+util\/xml/, path.resolve(__dirname, "./lib/util/xml.browser.ts")),
|
2018-10-26 23:59:05 +03:00
|
|
|
new webpack.NormalModuleReplacementPlugin(/(\.).+defaultHttpClient/, path.resolve(__dirname, "./lib/defaultHttpClient.browser.ts")),
|
2019-01-31 00:21:26 +03:00
|
|
|
new webpack.NormalModuleReplacementPlugin(/(\.).+msRestUserAgentPolicy/, path.resolve(__dirname, "./lib/policies/msRestUserAgentPolicy.browser.ts")),
|
|
|
|
new webpack.NormalModuleReplacementPlugin(/(\.).+proxyPolicy/, path.resolve(__dirname, "./lib/policies/proxyPolicy.browser.ts"))
|
2018-06-22 20:17:31 +03:00
|
|
|
],
|
2018-04-18 00:36:24 +03:00
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.tsx?$/,
|
2018-10-26 23:59:05 +03:00
|
|
|
loader: "ts-loader",
|
2018-06-06 01:54:37 +03:00
|
|
|
exclude: /(node_modules)/,
|
2018-10-26 23:59:05 +03:00
|
|
|
options: { configFile: path.join(__dirname, "./tsconfig.es.json") }
|
2018-04-18 00:36:24 +03:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
resolve: {
|
2018-06-04 20:10:02 +03:00
|
|
|
extensions: [".tsx", ".ts", ".js"]
|
2018-04-18 00:36:24 +03:00
|
|
|
},
|
|
|
|
node: {
|
2019-01-25 20:22:30 +03:00
|
|
|
dns: false,
|
2018-07-26 19:23:42 +03:00
|
|
|
fs: "empty",
|
2019-01-22 22:46:55 +03:00
|
|
|
net: "empty",
|
2018-07-26 19:23:42 +03:00
|
|
|
path: "empty",
|
2019-01-25 20:22:30 +03:00
|
|
|
process: "mock",
|
|
|
|
tls: "empty",
|
2018-04-18 00:36:24 +03:00
|
|
|
tty: false,
|
2019-01-25 20:22:30 +03:00
|
|
|
tunnel: "empty",
|
2018-04-18 00:36:24 +03:00
|
|
|
v8: false,
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2018-05-10 21:20:38 +03:00
|
|
|
export = config;
|