From 75192c91a9940c229b1babc05340edfce792e7d7 Mon Sep 17 00:00:00 2001 From: Akim McMath Date: Sun, 20 Mar 2016 23:07:07 -0700 Subject: [PATCH] Webpack: Make Resolve.alias optional The alias property on the Resolve interface was incorrectly declared as required. This commit makes it optional. Files changed: - webpack/webpack.d.ts: Set Resolve.alias to optional - webpack/webpack-tests.ts: Add new test which would have failed but now passes Documentation: https://webpack.github.io/docs/configuration.html#resolve-alias --- webpack/webpack-tests.ts | 6 ++++++ webpack/webpack.d.ts | 3 +-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/webpack/webpack-tests.ts b/webpack/webpack-tests.ts index 65f3fa720..9f2efe15c 100644 --- a/webpack/webpack-tests.ts +++ b/webpack/webpack-tests.ts @@ -247,6 +247,12 @@ configuration = { devtool: "#inline-source-map" }; +configuration = { + resolve: { + root: __dirname + } +}; + loader = { test: /\.jsx$/, include: [ diff --git a/webpack/webpack.d.ts b/webpack/webpack.d.ts index 82825dc28..035b49b01 100644 --- a/webpack/webpack.d.ts +++ b/webpack/webpack.d.ts @@ -147,7 +147,7 @@ declare module "webpack" { interface Resolve { /** Replace modules by other modules or paths. */ - alias: { [key: string]: string; }; + alias?: { [key: string]: string; }; /** * The directory (absolute path) that contains your modules. * May also be an array of directories. @@ -536,4 +536,3 @@ declare module "webpack" { //export default webpack; export = webpack; } -