ms-rest-js/webpack.testconfig.ts

63 строки
1.6 KiB
TypeScript
Исходник Обычный вид История

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
const config: webpack.Configuration = {
entry: glob.sync(path.join(__dirname, "test/**/*.ts")),
2018-10-26 23:59:05 +03:00
mode: "development",
devtool: "source-map",
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: {
filename: "msRest.browser.test.js",
path: path.resolve(__dirname, "test")
2018-04-18 00:36:24 +03:00
},
plugins: [
new webpack.NormalModuleReplacementPlugin(/(\.).+util\/base64/, path.resolve(__dirname, "./lib/util/base64.browser.ts")),
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")),
new webpack.NormalModuleReplacementPlugin(/(\.).+msRestUserAgentPolicy/, path.resolve(__dirname, "./lib/policies/msRestUserAgentPolicy.browser.ts"))
],
2018-04-18 00:36:24 +03:00
module: {
rules: [
{
test: /\.tsx?$/,
2018-10-26 23:59:05 +03:00
loader: "ts-loader",
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: {
fs: "empty",
net: "empty",
path: "empty",
2018-04-18 00:36:24 +03:00
dns: false,
tls: false,
tty: false,
v8: false,
Buffer: false,
process: false,
stream: "empty"
2018-04-18 00:36:24 +03:00
}
};
export = config;