@rushstack/heft-webpack4-plugin 0.6.0-dev.1 → 0.6.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -57,7 +57,11 @@ export declare interface IWebpackPluginAccessor {
57
57
  /**
58
58
  * Hooks that are called at various points in the Webpack plugin lifecycle.
59
59
  */
60
- hooks: IWebpackPluginAccessorHooks;
60
+ readonly hooks: IWebpackPluginAccessorHooks;
61
+ /**
62
+ * Parameters that are provided by the Webpack plugin.
63
+ */
64
+ readonly parameters: IWebpackPluginAccessorParameters;
61
65
  }
62
66
 
63
67
  /**
@@ -95,6 +99,16 @@ export declare interface IWebpackPluginAccessorHooks {
95
99
  /**
96
100
  * @public
97
101
  */
98
- export declare const PluginName: 'Webpack4Plugin';
102
+ export declare interface IWebpackPluginAccessorParameters {
103
+ /**
104
+ * Whether or not serve mode was enabled by passing the `--serve` flag.
105
+ */
106
+ readonly isServeMode: boolean;
107
+ }
108
+
109
+ /**
110
+ * @public
111
+ */
112
+ export declare const PluginName: 'webpack4-plugin';
99
113
 
100
114
  export { }
package/heft-plugin.json CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  "taskPlugins": [
5
5
  {
6
- "pluginName": "Webpack4Plugin",
6
+ "pluginName": "webpack4-plugin",
7
7
  "entryPoint": "./lib/Webpack4Plugin",
8
8
  "optionsSchema": "./lib/schemas/heft-webpack4-plugin.schema.json",
9
9
 
@@ -7,19 +7,20 @@ export interface IWebpackPluginOptions {
7
7
  /**
8
8
  * @public
9
9
  */
10
- export declare const PLUGIN_NAME: 'Webpack4Plugin';
10
+ export declare const PLUGIN_NAME: 'webpack4-plugin';
11
11
  /**
12
12
  * @internal
13
13
  */
14
14
  export default class Webpack4Plugin implements IHeftTaskPlugin<IWebpackPluginOptions> {
15
- private _serve;
15
+ private _accessor;
16
+ private _isServeMode;
16
17
  private _webpack;
17
18
  private _webpackCompiler;
18
19
  private _webpackConfiguration;
19
20
  private _webpackWatchers;
20
21
  private _webpackCompilationDonePromise;
21
22
  private _webpackCompilationDonePromiseResolveFn;
22
- readonly accessor: IWebpackPluginAccessor;
23
+ get accessor(): IWebpackPluginAccessor;
23
24
  apply(taskSession: IHeftTaskSession, heftConfiguration: HeftConfiguration, options: IWebpackPluginOptions): void;
24
25
  private _getWebpackConfigurationAsync;
25
26
  private _loadWebpackAsync;
@@ -1 +1 @@
1
- {"version":3,"file":"Webpack4Plugin.d.ts","sourceRoot":"","sources":["../src/Webpack4Plugin.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,iBAAiB,EACjB,gBAAgB,EAEhB,eAAe,EAIhB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAGV,sBAAsB,EACvB,MAAM,UAAU,CAAC;AA8BlB,MAAM,WAAW,qBAAqB;IACpC,oBAAoB,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAC;CACvC;AAED;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,gBAAmC,CAAC;AAQ9D;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,cAAe,YAAW,eAAe,CAAC,qBAAqB,CAAC;IACnF,OAAO,CAAC,MAAM,CAAkB;IAChC,OAAO,CAAC,QAAQ,CAA8B;IAC9C,OAAO,CAAC,gBAAgB,CAAuD;IAC/E,OAAO,CAAC,qBAAqB,CAA2E;IACxG,OAAO,CAAC,gBAAgB,CAAiC;IACzD,OAAO,CAAC,8BAA8B,CAA4B;IAClE,OAAO,CAAC,uCAAuC,CAA2B;IAE1E,SAAgB,QAAQ,EAAE,sBAAsB,CAO9C;IAEK,KAAK,CACV,WAAW,EAAE,gBAAgB,EAC7B,iBAAiB,EAAE,iBAAiB,EACpC,OAAO,EAAE,qBAAqB,GAC7B,IAAI;YA4CO,6BAA6B;YAoD7B,iBAAiB;YAQjB,wBAAwB;YAgBxB,gBAAgB;YA6ChB,qBAAqB;IA6KnC,OAAO,CAAC,4BAA4B;IAYpC,OAAO,CAAC,WAAW;CAapB"}
1
+ {"version":3,"file":"Webpack4Plugin.d.ts","sourceRoot":"","sources":["../src/Webpack4Plugin.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EAIhB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAyB,sBAAsB,EAAE,MAAM,UAAU,CAAC;AA8B9E,MAAM,WAAW,qBAAqB;IACpC,oBAAoB,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAC;CACvC;AAED;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,iBAAqC,CAAC;AAQhE;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,cAAe,YAAW,eAAe,CAAC,qBAAqB,CAAC;IACnF,OAAO,CAAC,SAAS,CAAqC;IACtD,OAAO,CAAC,YAAY,CAAkB;IACtC,OAAO,CAAC,QAAQ,CAA8B;IAC9C,OAAO,CAAC,gBAAgB,CAAuD;IAC/E,OAAO,CAAC,qBAAqB,CAA2E;IACxG,OAAO,CAAC,gBAAgB,CAAiC;IACzD,OAAO,CAAC,8BAA8B,CAA4B;IAClE,OAAO,CAAC,uCAAuC,CAA2B;IAE1E,IAAW,QAAQ,IAAI,sBAAsB,CAe5C;IAEM,KAAK,CACV,WAAW,EAAE,gBAAgB,EAC7B,iBAAiB,EAAE,iBAAiB,EACpC,OAAO,EAAE,qBAAqB,GAC7B,IAAI;YAsBO,6BAA6B;YAoD7B,iBAAiB;YAQjB,wBAAwB;YAgBxB,gBAAgB;YA6ChB,qBAAqB;IAgMnC,OAAO,CAAC,4BAA4B;IAYpC,OAAO,CAAC,WAAW;CAapB"}
@@ -33,7 +33,7 @@ const WebpackConfigurationLoader_1 = require("./WebpackConfigurationLoader");
33
33
  /**
34
34
  * @public
35
35
  */
36
- exports.PLUGIN_NAME = 'Webpack4Plugin';
36
+ exports.PLUGIN_NAME = 'webpack4-plugin';
37
37
  const SERVE_PARAMETER_LONG_NAME = '--serve';
38
38
  const WEBPACK_PACKAGE_NAME = 'webpack';
39
39
  const WEBPACK_DEV_SERVER_PACKAGE_NAME = 'webpack-dev-server';
@@ -45,40 +45,30 @@ const UNINITIALIZED = 'UNINITIALIZED';
45
45
  */
46
46
  class Webpack4Plugin {
47
47
  constructor() {
48
- this._serve = false;
48
+ this._isServeMode = false;
49
49
  this._webpackConfiguration = UNINITIALIZED;
50
- this.accessor = {
51
- hooks: {
52
- onLoadConfiguration: new tapable_1.AsyncSeriesBailHook(),
53
- onConfigure: new tapable_1.AsyncSeriesHook(['webpackConfiguration']),
54
- onAfterConfigure: new tapable_1.AsyncParallelHook(['webpackConfiguration']),
55
- onEmitStats: new tapable_1.AsyncParallelHook(['webpackStats'])
56
- }
57
- };
50
+ }
51
+ get accessor() {
52
+ if (!this._accessor) {
53
+ this._accessor = {
54
+ hooks: {
55
+ onLoadConfiguration: new tapable_1.AsyncSeriesBailHook(),
56
+ onConfigure: new tapable_1.AsyncSeriesHook(['webpackConfiguration']),
57
+ onAfterConfigure: new tapable_1.AsyncParallelHook(['webpackConfiguration']),
58
+ onEmitStats: new tapable_1.AsyncParallelHook(['webpackStats'])
59
+ },
60
+ parameters: {
61
+ isServeMode: this._isServeMode
62
+ }
63
+ };
64
+ }
65
+ return this._accessor;
58
66
  }
59
67
  apply(taskSession, heftConfiguration, options) {
60
- this._serve = taskSession.parameters.getFlagParameter(SERVE_PARAMETER_LONG_NAME).value;
61
- if (!taskSession.parameters.watch && this._serve) {
68
+ this._isServeMode = taskSession.parameters.getFlagParameter(SERVE_PARAMETER_LONG_NAME).value;
69
+ if (!taskSession.parameters.watch && this._isServeMode) {
62
70
  throw new Error(`The ${JSON.stringify(SERVE_PARAMETER_LONG_NAME)} parameter is only available when running in watch mode.`);
63
71
  }
64
- taskSession.hooks.clean.tapPromise(exports.PLUGIN_NAME, async (cleanOptions) => {
65
- var _a;
66
- // Obtain the finalized webpack configuration
67
- const webpackConfiguration = await this._getWebpackConfigurationAsync(taskSession, heftConfiguration, options);
68
- if (webpackConfiguration) {
69
- const webpackConfigurationArray = Array.isArray(webpackConfiguration)
70
- ? webpackConfiguration
71
- : [webpackConfiguration];
72
- // Add each output path to the clean list
73
- // NOTE: Webpack plugins that write assets to paths that start with '../' or outside of the
74
- // `output.path` will need to be manually added to the phase-level cleanup list in heft.json.
75
- for (const config of webpackConfigurationArray) {
76
- if ((_a = config.output) === null || _a === void 0 ? void 0 : _a.path) {
77
- cleanOptions.addDeleteOperations({ sourcePath: config.output.path });
78
- }
79
- }
80
- }
81
- });
82
72
  taskSession.hooks.run.tapPromise(exports.PLUGIN_NAME, async (runOptions) => {
83
73
  await this._runWebpackAsync(taskSession, heftConfiguration, options);
84
74
  });
@@ -94,7 +84,7 @@ class Webpack4Plugin {
94
84
  let webpackConfiguration = await this.accessor.hooks.onLoadConfiguration.promise();
95
85
  if (webpackConfiguration === undefined) {
96
86
  taskSession.logger.terminal.writeVerboseLine('Attempt to load the default Webpack configuration');
97
- const configurationLoader = new WebpackConfigurationLoader_1.WebpackConfigurationLoader(taskSession.logger, taskSession.parameters.production, taskSession.parameters.watch && this._serve);
87
+ const configurationLoader = new WebpackConfigurationLoader_1.WebpackConfigurationLoader(taskSession.logger, taskSession.parameters.production, taskSession.parameters.watch && this._isServeMode);
98
88
  webpackConfiguration = await configurationLoader.tryLoadWebpackConfigurationAsync(Object.assign(Object.assign({}, options), { taskSession,
99
89
  heftConfiguration, loadWebpackAsyncFn: this._loadWebpackAsync.bind(this) }));
100
90
  }
@@ -140,7 +130,7 @@ class Webpack4Plugin {
140
130
  }
141
131
  async _runWebpackAsync(taskSession, heftConfiguration, options) {
142
132
  this._validateEnvironmentVariable(taskSession);
143
- if (taskSession.parameters.watch || this._serve) {
133
+ if (taskSession.parameters.watch || this._isServeMode) {
144
134
  // Should never happen, but just in case
145
135
  throw new node_core_library_1.InternalError('Cannot run Webpack in compilation mode when watch mode is enabled');
146
136
  }
@@ -168,7 +158,7 @@ class Webpack4Plugin {
168
158
  }
169
159
  }
170
160
  async _runWebpackWatchAsync(taskSession, heftConfiguration, options) {
171
- var _a;
161
+ var _a, _b;
172
162
  // Save a handle to the original promise, since the this-scoped promise will be replaced whenever
173
163
  // the compilation completes.
174
164
  let webpackCompilationDonePromise = this._webpackCompilationDonePromise;
@@ -210,7 +200,7 @@ class Webpack4Plugin {
210
200
  };
211
201
  // Determine how we will run the compiler. When serving, we will run the compiler
212
202
  // via the webpack-dev-server. Otherwise, we will run the compiler directly.
213
- if (this._serve) {
203
+ if (this._isServeMode) {
214
204
  const defaultDevServerOptions = {
215
205
  host: 'localhost',
216
206
  devMiddleware: {
@@ -222,7 +212,10 @@ class Webpack4Plugin {
222
212
  }
223
213
  },
224
214
  client: {
225
- logging: 'info'
215
+ logging: 'info',
216
+ webSocketURL: {
217
+ port: 8080
218
+ }
226
219
  },
227
220
  port: 8080,
228
221
  onListening: (server) => {
@@ -252,11 +245,22 @@ class Webpack4Plugin {
252
245
  if (!devServerOptions.server) {
253
246
  const certificateManager = new debug_certificate_manager_1.CertificateManager();
254
247
  const certificate = await certificateManager.ensureCertificateAsync(true, taskSession.logger.terminal);
248
+ // Update the web socket URL to use the hostname provided by the certificate
249
+ const clientConfiguration = devServerOptions.client;
250
+ const hostname = (_a = certificate.subjectAltNames) === null || _a === void 0 ? void 0 : _a[0];
251
+ if (hostname && typeof clientConfiguration === 'object') {
252
+ const { webSocketURL } = clientConfiguration;
253
+ if (typeof webSocketURL === 'object') {
254
+ clientConfiguration.webSocketURL = Object.assign(Object.assign({}, webSocketURL), { hostname });
255
+ }
256
+ }
255
257
  devServerOptions = Object.assign(Object.assign({}, devServerOptions), { server: {
256
258
  type: 'https',
257
259
  options: {
260
+ minVersion: 'TLSv1.3',
258
261
  key: certificate.pemKey,
259
- cert: certificate.pemCertificate
262
+ cert: certificate.pemCertificate,
263
+ ca: certificate.pemCaCertificate
260
264
  }
261
265
  } });
262
266
  }
@@ -292,7 +296,7 @@ class Webpack4Plugin {
292
296
  });
293
297
  }
294
298
  // Store the watchers to be used for suspend/resume
295
- this._webpackWatchers = ((_a = compiler.compilers) !== null && _a !== void 0 ? _a : [compiler]).map((compiler) => compiler.watching);
299
+ this._webpackWatchers = ((_b = compiler.compilers) !== null && _b !== void 0 ? _b : [compiler]).map((compiler) => compiler.watching);
296
300
  }
297
301
  // Resume the compilation, wait for the compilation to complete, then suspend the watchers until the
298
302
  // next iteration. Even if there are no changes, the promise should resolve since resuming from a
@@ -307,7 +311,7 @@ class Webpack4Plugin {
307
311
  }
308
312
  }
309
313
  _validateEnvironmentVariable(taskSession) {
310
- if (!this._serve && process.env[WEBPACK_DEV_SERVER_ENV_VAR_NAME]) {
314
+ if (!this._isServeMode && process.env[WEBPACK_DEV_SERVER_ENV_VAR_NAME]) {
311
315
  taskSession.logger.emitWarning(new Error(`The "${WEBPACK_DEV_SERVER_ENV_VAR_NAME}" environment variable is set, ` +
312
316
  'which will cause problems when webpack is not running in serve mode. ' +
313
317
  `(Did a dependency inadvertently load the "${WEBPACK_DEV_SERVER_PACKAGE_NAME}" package?)`));
@@ -1 +1 @@
1
- {"version":3,"file":"Webpack4Plugin.js","sourceRoot":"","sources":["../src/Webpack4Plugin.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;AAK3D,qCAAqG;AACrG,oFAA6F;AAC7F,oEAA6E;AAgB7E,6EAA0E;AAkC1E;;GAEG;AACU,QAAA,WAAW,GAAqB,gBAAgB,CAAC;AAC9D,MAAM,yBAAyB,GAAc,SAAS,CAAC;AACvD,MAAM,oBAAoB,GAAc,SAAS,CAAC;AAClD,MAAM,+BAA+B,GAAyB,oBAAoB,CAAC;AACnF,MAAM,+BAA+B,GAAyB,oBAAoB,CAAC;AACnF,MAAM,mCAAmC,GAA6B,wBAAwB,CAAC;AAC/F,MAAM,aAAa,GAAoB,eAAe,CAAC;A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AI,eAAe,CAAC,QAA8B,EAAE;gBACpE,MAAM,CAAC,WAAW,CAAC,OAAO,YAAY,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;aAC7E;YAED,KAAK,MAAM,KAAK,IAAI,eAAe,CAAC,MAA4B,EAAE;gBAChE,MAAM,CAAC,SAAS,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;aACrE;SACF;IACH,CAAC;CACF;AAjYD,iCAiYC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport type { AddressInfo } from 'net';\nimport type * as TWebpack from 'webpack';\nimport type TWebpackDevServer from 'webpack-dev-server';\nimport { AsyncParallelHook, AsyncSeriesBailHook, AsyncSeriesHook, type SyncBailHook } from 'tapable';\nimport { CertificateManager, type ICertificate } from '@rushstack/debug-certificate-manager';\nimport { InternalError, LegacyAdapters } from '@rushstack/node-core-library';\nimport type {\n HeftConfiguration,\n IHeftTaskSession,\n IHeftTaskCleanHookOptions,\n IHeftTaskPlugin,\n IHeftTaskRunHookOptions,\n IScopedLogger,\n IHeftTaskRunIncrementalHookOptions\n} from '@rushstack/heft';\n\nimport type {\n IWebpackConfiguration,\n IWebpackConfigurationWithDevServer,\n IWebpackPluginAccessor\n} from './shared';\nimport { WebpackConfigurationLoader } from './WebpackConfigurationLoader';\n\ntype ExtendedWatching = TWebpack.Watching & {\n resume: () => void;\n suspend: () => void;\n};\n\ntype ExtendedMultiWatching = TWebpack.MultiWatching & {\n resume: () => void;\n suspend: () => void;\n};\n\ntype ExtendedCompiler = TWebpack.Compiler & {\n hooks: TWebpack.Compiler['hooks'] & {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n infrastructureLog: SyncBailHook<string, string, any[]>;\n };\n watching: ExtendedWatching;\n};\n\ntype ExtendedMultiCompiler = TWebpack.MultiCompiler & {\n compilers: ExtendedCompiler[];\n hooks: TWebpack.MultiCompiler['hooks'] & {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n infrastructureLog: SyncBailHook<string, string, any[]>;\n };\n watching: ExtendedMultiWatching;\n};\n\nexport interface IWebpackPluginOptions {\n devConfigurationPath: string | undefined;\n configurationPath: string | undefined;\n}\n\n/**\n * @public\n */\nexport const PLUGIN_NAME: 'Webpack4Plugin' = 'Webpack4Plugin';\nconst SERVE_PARAMETER_LONG_NAME: '--serve' = '--serve';\nconst WEBPACK_PACKAGE_NAME: 'webpack' = 'webpack';\nconst WEBPACK_DEV_SERVER_PACKAGE_NAME: 'webpack-dev-server' = 'webpack-dev-server';\nconst WEBPACK_DEV_SERVER_ENV_VAR_NAME: 'WEBPACK_DEV_SERVER' = 'WEBPACK_DEV_SERVER';\nconst WEBPACK_DEV_MIDDLEWARE_PACKAGE_NAME: 'webpack-dev-middleware' = 'webpack-dev-middleware';\nconst UNINITIALIZED: 'UNINITIALIZED' = 'UNINITIALIZED';\n\n/**\n * @internal\n */\nexport default class Webpack4Plugin implements IHeftTaskPlugin<IWebpackPluginOptions> {\n private _serve: boolean = false;\n private _webpack: typeof TWebpack | undefined;\n private _webpackCompiler: ExtendedCompiler | ExtendedMultiCompiler | undefined;\n private _webpackConfiguration: IWebpackConfiguration | undefined | typeof UNINITIALIZED = UNINITIALIZED;\n private _webpackWatchers: ExtendedWatching[] | undefined;\n private _webpackCompilationDonePromise: Promise<void> | undefined;\n private _webpackCompilationDonePromiseResolveFn: (() => void) | undefined;\n\n public readonly accessor: IWebpackPluginAccessor = {\n hooks: {\n onLoadConfiguration: new AsyncSeriesBailHook(),\n onConfigure: new AsyncSeriesHook(['webpackConfiguration']),\n onAfterConfigure: new AsyncParallelHook(['webpackConfiguration']),\n onEmitStats: new AsyncParallelHook(['webpackStats'])\n }\n };\n\n public apply(\n taskSession: IHeftTaskSession,\n heftConfiguration: HeftConfiguration,\n options: IWebpackPluginOptions\n ): void {\n this._serve = taskSession.parameters.getFlagParameter(SERVE_PARAMETER_LONG_NAME).value;\n if (!taskSession.parameters.watch && this._serve) {\n throw new Error(\n `The ${JSON.stringify(\n SERVE_PARAMETER_LONG_NAME\n )} parameter is only available when running in watch mode.`\n );\n }\n\n taskSession.hooks.clean.tapPromise(PLUGIN_NAME, async (cleanOptions: IHeftTaskCleanHookOptions) => {\n // Obtain the finalized webpack configuration\n const webpackConfiguration: IWebpackConfiguration | undefined =\n await this._getWebpackConfigurationAsync(taskSession, heftConfiguration, options);\n if (webpackConfiguration) {\n const webpackConfigurationArray: IWebpackConfigurationWithDevServer[] = Array.isArray(\n webpackConfiguration\n )\n ? webpackConfiguration\n : [webpackConfiguration];\n\n // Add each output path to the clean list\n // NOTE: Webpack plugins that write assets to paths that start with '../' or outside of the\n // `output.path` will need to be manually added to the phase-level cleanup list in heft.json.\n for (const config of webpackConfigurationArray) {\n if (config.output?.path) {\n cleanOptions.addDeleteOperations({ sourcePath: config.output.path });\n }\n }\n }\n });\n\n taskSession.hooks.run.tapPromise(PLUGIN_NAME, async (runOptions: IHeftTaskRunHookOptions) => {\n await this._runWebpackAsync(taskSession, heftConfiguration, options);\n });\n\n taskSession.hooks.runIncremental.tapPromise(\n PLUGIN_NAME,\n async (runOptions: IHeftTaskRunIncrementalHookOptions) => {\n await this._runWebpackWatchAsync(taskSession, heftConfiguration, options);\n }\n );\n }\n\n private async _getWebpackConfigurationAsync(\n taskSession: IHeftTaskSession,\n heftConfiguration: HeftConfiguration,\n options: IWebpackPluginOptions\n ): Promise<IWebpackConfiguration | undefined> {\n if (this._webpackConfiguration === UNINITIALIZED) {\n // Obtain the webpack configuration by calling into the hook. If undefined\n // is returned, load the default Webpack configuration.\n taskSession.logger.terminal.writeVerboseLine(\n 'Attempting to load Webpack configuration via external plugins'\n );\n let webpackConfiguration: IWebpackConfiguration | false | undefined =\n await this.accessor.hooks.onLoadConfiguration.promise();\n if (webpackConfiguration === undefined) {\n taskSession.logger.terminal.writeVerboseLine('Attempt to load the default Webpack configuration');\n const configurationLoader: WebpackConfigurationLoader = new WebpackConfigurationLoader(\n taskSession.logger,\n taskSession.parameters.production,\n taskSession.parameters.watch && this._serve\n );\n webpackConfiguration = await configurationLoader.tryLoadWebpackConfigurationAsync({\n ...options,\n taskSession,\n heftConfiguration,\n loadWebpackAsyncFn: this._loadWebpackAsync.bind(this)\n });\n }\n\n if (webpackConfiguration === false) {\n taskSession.logger.terminal.writeLine('Webpack disabled by external plugin');\n this._webpackConfiguration = undefined;\n } else if (\n webpackConfiguration === undefined ||\n (Array.isArray(webpackConfiguration) && webpackConfiguration.length === 0)\n ) {\n taskSession.logger.terminal.writeLine('No Webpack configuration found');\n this._webpackConfiguration = undefined;\n } else {\n if (this.accessor.hooks.onConfigure.isUsed()) {\n // Allow for plugins to customise the configuration\n await this.accessor.hooks.onConfigure.promise(webpackConfiguration);\n }\n if (this.accessor.hooks.onAfterConfigure.isUsed()) {\n // Provide the finalized configuration\n await this.accessor.hooks.onAfterConfigure.promise(webpackConfiguration);\n }\n this._webpackConfiguration = webpackConfiguration;\n }\n }\n return this._webpackConfiguration;\n }\n\n private async _loadWebpackAsync(): Promise<typeof TWebpack> {\n if (!this._webpack) {\n // Allow this to fail if webpack is not installed\n this._webpack = await import(WEBPACK_PACKAGE_NAME);\n }\n return this._webpack!;\n }\n\n private async _getWebpackCompilerAsync(\n taskSession: IHeftTaskSession,\n webpackConfiguration: IWebpackConfiguration\n ): Promise<ExtendedCompiler | ExtendedMultiCompiler> {\n if (!this._webpackCompiler) {\n const webpack: typeof TWebpack = await this._loadWebpackAsync();\n taskSession.logger.terminal.writeLine(`Using Webpack version ${webpack.version}`);\n this._webpackCompiler = Array.isArray(webpackConfiguration)\n ? (webpack.default(\n webpackConfiguration\n ) as ExtendedMultiCompiler) /* (webpack.Compilation[]) => MultiCompiler */\n : (webpack.default(webpackConfiguration) as ExtendedCompiler); /* (webpack.Compilation) => Compiler */\n }\n return this._webpackCompiler;\n }\n\n private async _runWebpackAsync(\n taskSession: IHeftTaskSession,\n heftConfiguration: HeftConfiguration,\n options: IWebpackPluginOptions\n ): Promise<void> {\n this._validateEnvironmentVariable(taskSession);\n if (taskSession.parameters.watch || this._serve) {\n // Should never happen, but just in case\n throw new InternalError('Cannot run Webpack in compilation mode when watch mode is enabled');\n }\n\n // Load the config and compiler, and return if there is no config found\n const webpackConfiguration: IWebpackConfiguration | undefined = await this._getWebpackConfigurationAsync(\n taskSession,\n heftConfiguration,\n options\n );\n if (!webpackConfiguration) {\n return;\n }\n const compiler: ExtendedCompiler | ExtendedMultiCompiler = await this._getWebpackCompilerAsync(\n taskSession,\n webpackConfiguration\n );\n taskSession.logger.terminal.writeLine('Running Webpack compilation');\n\n // Run the webpack compiler\n let stats: TWebpack.Stats | TWebpack.MultiStats | undefined;\n try {\n stats = await LegacyAdapters.convertCallbackToPromise(\n (compiler as TWebpack.Compiler).run.bind(compiler)\n );\n } catch (e) {\n taskSession.logger.emitError(e as Error);\n }\n\n // Emit the errors from the stats object, if present\n if (stats) {\n this._emitErrors(taskSession.logger, stats);\n if (this.accessor.hooks.onEmitStats.isUsed()) {\n await this.accessor.hooks.onEmitStats.promise(stats);\n }\n }\n }\n\n private async _runWebpackWatchAsync(\n taskSession: IHeftTaskSession,\n heftConfiguration: HeftConfiguration,\n options: IWebpackPluginOptions\n ): Promise<void> {\n // Save a handle to the original promise, since the this-scoped promise will be replaced whenever\n // the compilation completes.\n let webpackCompilationDonePromise: Promise<void> | undefined = this._webpackCompilationDonePromise;\n\n if (!this._webpackWatchers) {\n this._validateEnvironmentVariable(taskSession);\n if (!taskSession.parameters.watch) {\n // Should never happen, but just in case\n throw new InternalError('Cannot run Webpack in watch mode when compilation mode is enabled');\n }\n\n // Load the config and compiler, and return if there is no config found\n const webpackConfiguration: IWebpackConfiguration | undefined =\n await this._getWebpackConfigurationAsync(taskSession, heftConfiguration, options);\n if (!webpackConfiguration) {\n return;\n }\n\n // Get the compiler which will be used for both serve and watch mode\n const compiler: ExtendedCompiler | ExtendedMultiCompiler = await this._getWebpackCompilerAsync(\n taskSession,\n webpackConfiguration\n );\n\n // Set up the hook to detect when the watcher completes the watcher compilation. We will also log out\n // errors from the compilation if present from the output stats object.\n this._webpackCompilationDonePromise = new Promise((resolve: () => void) => {\n this._webpackCompilationDonePromiseResolveFn = resolve;\n });\n webpackCompilationDonePromise = this._webpackCompilationDonePromise;\n compiler.hooks.done.tap(PLUGIN_NAME, (stats?: TWebpack.Stats | TWebpack.MultiStats) => {\n this._webpackCompilationDonePromiseResolveFn!();\n this._webpackCompilationDonePromise = new Promise((resolve: () => void) => {\n this._webpackCompilationDonePromiseResolveFn = resolve;\n });\n if (stats) {\n this._emitErrors(taskSession.logger, stats);\n }\n });\n\n // TWebpack.Compiler and TWebpack.MultiCompiler in Webpack 4 do not allow you to access the running\n // watcher, so we need to patch the method to set the watcher on the parent object.\n const originalWatch: TWebpack.Compiler['watch'] | TWebpack.MultiCompiler['watch'] =\n compiler.watch.bind(compiler);\n compiler.watch = (\n watchOptions: TWebpack.ICompiler.WatchOptions,\n handler: TWebpack.ICompiler.Handler & TWebpack.ICompiler.MultiHandler\n ) => {\n const watcher: ExtendedWatching | ExtendedMultiWatching = originalWatch(watchOptions, handler) as\n | ExtendedWatching\n | ExtendedMultiWatching;\n compiler.watching = watcher;\n return watcher;\n };\n\n // Determine how we will run the compiler. When serving, we will run the compiler\n // via the webpack-dev-server. Otherwise, we will run the compiler directly.\n if (this._serve) {\n const defaultDevServerOptions: TWebpackDevServer.Configuration = {\n host: 'localhost',\n devMiddleware: {\n publicPath: '/',\n stats: {\n cached: false,\n cachedAssets: false,\n colors: heftConfiguration.terminalProvider.supportsColor\n }\n },\n client: {\n logging: 'info'\n },\n port: 8080,\n onListening: (server: TWebpackDevServer) => {\n const addressInfo: AddressInfo | string | undefined = server.server?.address() as AddressInfo;\n if (addressInfo) {\n const address: string =\n typeof addressInfo === 'string' ? addressInfo : `${addressInfo.address}:${addressInfo.port}`;\n taskSession.logger.terminal.writeLine(`Started Webpack Dev Server at https://${address}`);\n }\n }\n };\n\n // Obtain the devServerOptions from the webpack configuration, and combine with the default options\n let devServerOptions: TWebpackDevServer.Configuration;\n if (Array.isArray(webpackConfiguration)) {\n const filteredDevServerOptions: TWebpackDevServer.Configuration[] = webpackConfiguration\n .map((configuration) => configuration.devServer)\n .filter((devServer): devServer is TWebpackDevServer.Configuration => !!devServer);\n if (filteredDevServerOptions.length > 1) {\n taskSession.logger.emitWarning(\n new Error(`Detected multiple webpack devServer configurations, using the first one.`)\n );\n }\n devServerOptions = { ...defaultDevServerOptions, ...filteredDevServerOptions[0] };\n } else {\n devServerOptions = { ...defaultDevServerOptions, ...webpackConfiguration.devServer };\n }\n\n // Add the certificate and key to the devServerOptions if these fields don't already have values\n if (!devServerOptions.server) {\n const certificateManager: CertificateManager = new CertificateManager();\n const certificate: ICertificate = await certificateManager.ensureCertificateAsync(\n true,\n taskSession.logger.terminal\n );\n devServerOptions = {\n ...devServerOptions,\n server: {\n type: 'https',\n options: {\n key: certificate.pemKey,\n cert: certificate.pemCertificate\n }\n }\n };\n }\n\n // Since the webpack-dev-server does not return infrastructure errors via a callback like\n // compiler.watch(...), we will need to intercept them and log them ourselves.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n compiler.hooks.infrastructureLog.tap(PLUGIN_NAME, (name: string, type: string, args: any[]) => {\n if (name === WEBPACK_DEV_MIDDLEWARE_PACKAGE_NAME && type === 'error') {\n const error: Error | undefined = args[0];\n if (error) {\n taskSession.logger.emitError(error);\n }\n }\n return true;\n });\n\n // The webpack-dev-server package has a design flaw, where merely loading its package will set the\n // WEBPACK_DEV_SERVER environment variable -- even if no APIs are accessed. This environment variable\n // causes incorrect behavior if Heft is not running in serve mode. Thus, we need to be careful to call\n // require() only if Heft is in serve mode.\n taskSession.logger.terminal.writeLine('Starting webpack-dev-server');\n const WebpackDevServer: typeof TWebpackDevServer = (await import(WEBPACK_DEV_SERVER_PACKAGE_NAME))\n .default;\n const webpackDevServer: TWebpackDevServer = new WebpackDevServer(devServerOptions, compiler);\n await webpackDevServer.start();\n } else {\n // Create the watcher. Compilation will start immediately after invoking watch().\n taskSession.logger.terminal.writeLine('Starting Webpack watcher');\n compiler.watch({}, (error?: Error | null) => {\n if (error) {\n taskSession.logger.emitError(error);\n }\n });\n }\n\n // Store the watchers to be used for suspend/resume\n this._webpackWatchers = (\n (compiler as ExtendedMultiCompiler).compilers ?? [compiler as ExtendedCompiler]\n ).map((compiler: ExtendedCompiler) => compiler.watching);\n }\n\n // Resume the compilation, wait for the compilation to complete, then suspend the watchers until the\n // next iteration. Even if there are no changes, the promise should resolve since resuming from a\n // suspended state invalidates the state of the watcher.\n taskSession.logger.terminal.writeLine('Running incremental Webpack compilation');\n for (const watcher of this._webpackWatchers) {\n watcher.resume();\n }\n await webpackCompilationDonePromise;\n for (const watcher of this._webpackWatchers) {\n watcher.suspend();\n }\n }\n\n private _validateEnvironmentVariable(taskSession: IHeftTaskSession): void {\n if (!this._serve && process.env[WEBPACK_DEV_SERVER_ENV_VAR_NAME]) {\n taskSession.logger.emitWarning(\n new Error(\n `The \"${WEBPACK_DEV_SERVER_ENV_VAR_NAME}\" environment variable is set, ` +\n 'which will cause problems when webpack is not running in serve mode. ' +\n `(Did a dependency inadvertently load the \"${WEBPACK_DEV_SERVER_PACKAGE_NAME}\" package?)`\n )\n );\n }\n }\n\n private _emitErrors(logger: IScopedLogger, stats: TWebpack.Stats | TWebpack.compilation.MultiStats): void {\n if (stats.hasErrors() || stats.hasWarnings()) {\n const serializedStats: TWebpack.Stats.ToJsonOutput = stats.toJson('errors-warnings');\n\n for (const warning of serializedStats.warnings as (string | Error)[]) {\n logger.emitWarning(warning instanceof Error ? warning : new Error(warning));\n }\n\n for (const error of serializedStats.errors as (string | Error)[]) {\n logger.emitError(error instanceof Error ? error : new Error(error));\n }\n }\n }\n}\n"]}
1
+ {"version":3,"file":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C;IAEO,4BAA4B,CAAC,WAA6B;QAChE,IAAI,CAAC,IAAI,CAAC,YAAY,IAAI,OAAO,CAAC,GAAG,CAAC,+BAA+B,CAAC,EAAE;YACtE,WAAW,CAAC,MAAM,CAAC,WAAW,CAC5B,IAAI,KAAK,CACP,QAAQ,+BAA+B,iCAAiC;gBACtE,uEAAuE;gBACvE,6CAA6C,+BAA+B,aAAa,CAC5F,CACF,CAAC;SACH;IACH,CAAC;IAEO,WAAW,CAAC,MAAqB,EAAE,KAAuD;QAChG,IAAI,KAAK,CAAC,SAAS,EAAE,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE;YAC5C,MAAM,eAAe,GAAgC,KAAK,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;YAErF,KAAK,MAAM,OAAO,IAAI,eAAe,CAAC,QAA8B,EAAE;gBACpE,MAAM,CAAC,WAAW,CAAC,OAAO,YAAY,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;aAC7E;YAED,KAAK,MAAM,KAAK,IAAI,eAAe,CAAC,MAA4B,EAAE;gBAChE,MAAM,CAAC,SAAS,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;aACrE;SACF;IACH,CAAC;CACF;AAvYD,iCAuYC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport type { AddressInfo } from 'net';\nimport type * as TWebpack from 'webpack';\nimport type TWebpackDevServer from 'webpack-dev-server';\nimport { AsyncParallelHook, AsyncSeriesBailHook, AsyncSeriesHook, type SyncBailHook } from 'tapable';\nimport { CertificateManager, type ICertificate } from '@rushstack/debug-certificate-manager';\nimport { InternalError, LegacyAdapters } from '@rushstack/node-core-library';\nimport type {\n HeftConfiguration,\n IHeftTaskSession,\n IHeftTaskPlugin,\n IHeftTaskRunHookOptions,\n IScopedLogger,\n IHeftTaskRunIncrementalHookOptions\n} from '@rushstack/heft';\n\nimport type { IWebpackConfiguration, IWebpackPluginAccessor } from './shared';\nimport { WebpackConfigurationLoader } from './WebpackConfigurationLoader';\n\ntype ExtendedWatching = TWebpack.Watching & {\n resume: () => void;\n suspend: () => void;\n};\n\ntype ExtendedMultiWatching = TWebpack.MultiWatching & {\n resume: () => void;\n suspend: () => void;\n};\n\ntype ExtendedCompiler = TWebpack.Compiler & {\n hooks: TWebpack.Compiler['hooks'] & {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n infrastructureLog: SyncBailHook<string, string, any[]>;\n };\n watching: ExtendedWatching;\n};\n\ntype ExtendedMultiCompiler = TWebpack.MultiCompiler & {\n compilers: ExtendedCompiler[];\n hooks: TWebpack.MultiCompiler['hooks'] & {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n infrastructureLog: SyncBailHook<string, string, any[]>;\n };\n watching: ExtendedMultiWatching;\n};\n\nexport interface IWebpackPluginOptions {\n devConfigurationPath: string | undefined;\n configurationPath: string | undefined;\n}\n\n/**\n * @public\n */\nexport const PLUGIN_NAME: 'webpack4-plugin' = 'webpack4-plugin';\nconst SERVE_PARAMETER_LONG_NAME: '--serve' = '--serve';\nconst WEBPACK_PACKAGE_NAME: 'webpack' = 'webpack';\nconst WEBPACK_DEV_SERVER_PACKAGE_NAME: 'webpack-dev-server' = 'webpack-dev-server';\nconst WEBPACK_DEV_SERVER_ENV_VAR_NAME: 'WEBPACK_DEV_SERVER' = 'WEBPACK_DEV_SERVER';\nconst WEBPACK_DEV_MIDDLEWARE_PACKAGE_NAME: 'webpack-dev-middleware' = 'webpack-dev-middleware';\nconst UNINITIALIZED: 'UNINITIALIZED' = 'UNINITIALIZED';\n\n/**\n * @internal\n */\nexport default class Webpack4Plugin implements IHeftTaskPlugin<IWebpackPluginOptions> {\n private _accessor: IWebpackPluginAccessor | undefined;\n private _isServeMode: boolean = false;\n private _webpack: typeof TWebpack | undefined;\n private _webpackCompiler: ExtendedCompiler | ExtendedMultiCompiler | undefined;\n private _webpackConfiguration: IWebpackConfiguration | undefined | typeof UNINITIALIZED = UNINITIALIZED;\n private _webpackWatchers: ExtendedWatching[] | undefined;\n private _webpackCompilationDonePromise: Promise<void> | undefined;\n private _webpackCompilationDonePromiseResolveFn: (() => void) | undefined;\n\n public get accessor(): IWebpackPluginAccessor {\n if (!this._accessor) {\n this._accessor = {\n hooks: {\n onLoadConfiguration: new AsyncSeriesBailHook(),\n onConfigure: new AsyncSeriesHook(['webpackConfiguration']),\n onAfterConfigure: new AsyncParallelHook(['webpackConfiguration']),\n onEmitStats: new AsyncParallelHook(['webpackStats'])\n },\n parameters: {\n isServeMode: this._isServeMode\n }\n };\n }\n return this._accessor;\n }\n\n public apply(\n taskSession: IHeftTaskSession,\n heftConfiguration: HeftConfiguration,\n options: IWebpackPluginOptions\n ): void {\n this._isServeMode = taskSession.parameters.getFlagParameter(SERVE_PARAMETER_LONG_NAME).value;\n if (!taskSession.parameters.watch && this._isServeMode) {\n throw new Error(\n `The ${JSON.stringify(\n SERVE_PARAMETER_LONG_NAME\n )} parameter is only available when running in watch mode.`\n );\n }\n\n taskSession.hooks.run.tapPromise(PLUGIN_NAME, async (runOptions: IHeftTaskRunHookOptions) => {\n await this._runWebpackAsync(taskSession, heftConfiguration, options);\n });\n\n taskSession.hooks.runIncremental.tapPromise(\n PLUGIN_NAME,\n async (runOptions: IHeftTaskRunIncrementalHookOptions) => {\n await this._runWebpackWatchAsync(taskSession, heftConfiguration, options);\n }\n );\n }\n\n private async _getWebpackConfigurationAsync(\n taskSession: IHeftTaskSession,\n heftConfiguration: HeftConfiguration,\n options: IWebpackPluginOptions\n ): Promise<IWebpackConfiguration | undefined> {\n if (this._webpackConfiguration === UNINITIALIZED) {\n // Obtain the webpack configuration by calling into the hook. If undefined\n // is returned, load the default Webpack configuration.\n taskSession.logger.terminal.writeVerboseLine(\n 'Attempting to load Webpack configuration via external plugins'\n );\n let webpackConfiguration: IWebpackConfiguration | false | undefined =\n await this.accessor.hooks.onLoadConfiguration.promise();\n if (webpackConfiguration === undefined) {\n taskSession.logger.terminal.writeVerboseLine('Attempt to load the default Webpack configuration');\n const configurationLoader: WebpackConfigurationLoader = new WebpackConfigurationLoader(\n taskSession.logger,\n taskSession.parameters.production,\n taskSession.parameters.watch && this._isServeMode\n );\n webpackConfiguration = await configurationLoader.tryLoadWebpackConfigurationAsync({\n ...options,\n taskSession,\n heftConfiguration,\n loadWebpackAsyncFn: this._loadWebpackAsync.bind(this)\n });\n }\n\n if (webpackConfiguration === false) {\n taskSession.logger.terminal.writeLine('Webpack disabled by external plugin');\n this._webpackConfiguration = undefined;\n } else if (\n webpackConfiguration === undefined ||\n (Array.isArray(webpackConfiguration) && webpackConfiguration.length === 0)\n ) {\n taskSession.logger.terminal.writeLine('No Webpack configuration found');\n this._webpackConfiguration = undefined;\n } else {\n if (this.accessor.hooks.onConfigure.isUsed()) {\n // Allow for plugins to customise the configuration\n await this.accessor.hooks.onConfigure.promise(webpackConfiguration);\n }\n if (this.accessor.hooks.onAfterConfigure.isUsed()) {\n // Provide the finalized configuration\n await this.accessor.hooks.onAfterConfigure.promise(webpackConfiguration);\n }\n this._webpackConfiguration = webpackConfiguration;\n }\n }\n return this._webpackConfiguration;\n }\n\n private async _loadWebpackAsync(): Promise<typeof TWebpack> {\n if (!this._webpack) {\n // Allow this to fail if webpack is not installed\n this._webpack = await import(WEBPACK_PACKAGE_NAME);\n }\n return this._webpack!;\n }\n\n private async _getWebpackCompilerAsync(\n taskSession: IHeftTaskSession,\n webpackConfiguration: IWebpackConfiguration\n ): Promise<ExtendedCompiler | ExtendedMultiCompiler> {\n if (!this._webpackCompiler) {\n const webpack: typeof TWebpack = await this._loadWebpackAsync();\n taskSession.logger.terminal.writeLine(`Using Webpack version ${webpack.version}`);\n this._webpackCompiler = Array.isArray(webpackConfiguration)\n ? (webpack.default(\n webpackConfiguration\n ) as ExtendedMultiCompiler) /* (webpack.Compilation[]) => MultiCompiler */\n : (webpack.default(webpackConfiguration) as ExtendedCompiler); /* (webpack.Compilation) => Compiler */\n }\n return this._webpackCompiler;\n }\n\n private async _runWebpackAsync(\n taskSession: IHeftTaskSession,\n heftConfiguration: HeftConfiguration,\n options: IWebpackPluginOptions\n ): Promise<void> {\n this._validateEnvironmentVariable(taskSession);\n if (taskSession.parameters.watch || this._isServeMode) {\n // Should never happen, but just in case\n throw new InternalError('Cannot run Webpack in compilation mode when watch mode is enabled');\n }\n\n // Load the config and compiler, and return if there is no config found\n const webpackConfiguration: IWebpackConfiguration | undefined = await this._getWebpackConfigurationAsync(\n taskSession,\n heftConfiguration,\n options\n );\n if (!webpackConfiguration) {\n return;\n }\n const compiler: ExtendedCompiler | ExtendedMultiCompiler = await this._getWebpackCompilerAsync(\n taskSession,\n webpackConfiguration\n );\n taskSession.logger.terminal.writeLine('Running Webpack compilation');\n\n // Run the webpack compiler\n let stats: TWebpack.Stats | TWebpack.MultiStats | undefined;\n try {\n stats = await LegacyAdapters.convertCallbackToPromise(\n (compiler as TWebpack.Compiler).run.bind(compiler)\n );\n } catch (e) {\n taskSession.logger.emitError(e as Error);\n }\n\n // Emit the errors from the stats object, if present\n if (stats) {\n this._emitErrors(taskSession.logger, stats);\n if (this.accessor.hooks.onEmitStats.isUsed()) {\n await this.accessor.hooks.onEmitStats.promise(stats);\n }\n }\n }\n\n private async _runWebpackWatchAsync(\n taskSession: IHeftTaskSession,\n heftConfiguration: HeftConfiguration,\n options: IWebpackPluginOptions\n ): Promise<void> {\n // Save a handle to the original promise, since the this-scoped promise will be replaced whenever\n // the compilation completes.\n let webpackCompilationDonePromise: Promise<void> | undefined = this._webpackCompilationDonePromise;\n\n if (!this._webpackWatchers) {\n this._validateEnvironmentVariable(taskSession);\n if (!taskSession.parameters.watch) {\n // Should never happen, but just in case\n throw new InternalError('Cannot run Webpack in watch mode when compilation mode is enabled');\n }\n\n // Load the config and compiler, and return if there is no config found\n const webpackConfiguration: IWebpackConfiguration | undefined =\n await this._getWebpackConfigurationAsync(taskSession, heftConfiguration, options);\n if (!webpackConfiguration) {\n return;\n }\n\n // Get the compiler which will be used for both serve and watch mode\n const compiler: ExtendedCompiler | ExtendedMultiCompiler = await this._getWebpackCompilerAsync(\n taskSession,\n webpackConfiguration\n );\n\n // Set up the hook to detect when the watcher completes the watcher compilation. We will also log out\n // errors from the compilation if present from the output stats object.\n this._webpackCompilationDonePromise = new Promise((resolve: () => void) => {\n this._webpackCompilationDonePromiseResolveFn = resolve;\n });\n webpackCompilationDonePromise = this._webpackCompilationDonePromise;\n compiler.hooks.done.tap(PLUGIN_NAME, (stats?: TWebpack.Stats | TWebpack.MultiStats) => {\n this._webpackCompilationDonePromiseResolveFn!();\n this._webpackCompilationDonePromise = new Promise((resolve: () => void) => {\n this._webpackCompilationDonePromiseResolveFn = resolve;\n });\n if (stats) {\n this._emitErrors(taskSession.logger, stats);\n }\n });\n\n // TWebpack.Compiler and TWebpack.MultiCompiler in Webpack 4 do not allow you to access the running\n // watcher, so we need to patch the method to set the watcher on the parent object.\n const originalWatch: TWebpack.Compiler['watch'] | TWebpack.MultiCompiler['watch'] =\n compiler.watch.bind(compiler);\n compiler.watch = (\n watchOptions: TWebpack.ICompiler.WatchOptions,\n handler: TWebpack.ICompiler.Handler & TWebpack.ICompiler.MultiHandler\n ) => {\n const watcher: ExtendedWatching | ExtendedMultiWatching = originalWatch(watchOptions, handler) as\n | ExtendedWatching\n | ExtendedMultiWatching;\n compiler.watching = watcher;\n return watcher;\n };\n\n // Determine how we will run the compiler. When serving, we will run the compiler\n // via the webpack-dev-server. Otherwise, we will run the compiler directly.\n if (this._isServeMode) {\n const defaultDevServerOptions: TWebpackDevServer.Configuration = {\n host: 'localhost',\n devMiddleware: {\n publicPath: '/',\n stats: {\n cached: false,\n cachedAssets: false,\n colors: heftConfiguration.terminalProvider.supportsColor\n }\n },\n client: {\n logging: 'info',\n webSocketURL: {\n port: 8080\n }\n },\n port: 8080,\n onListening: (server: TWebpackDevServer) => {\n const addressInfo: AddressInfo | string | undefined = server.server?.address() as AddressInfo;\n if (addressInfo) {\n const address: string =\n typeof addressInfo === 'string' ? addressInfo : `${addressInfo.address}:${addressInfo.port}`;\n taskSession.logger.terminal.writeLine(`Started Webpack Dev Server at https://${address}`);\n }\n }\n };\n\n // Obtain the devServerOptions from the webpack configuration, and combine with the default options\n let devServerOptions: TWebpackDevServer.Configuration;\n if (Array.isArray(webpackConfiguration)) {\n const filteredDevServerOptions: TWebpackDevServer.Configuration[] = webpackConfiguration\n .map((configuration) => configuration.devServer)\n .filter((devServer): devServer is TWebpackDevServer.Configuration => !!devServer);\n if (filteredDevServerOptions.length > 1) {\n taskSession.logger.emitWarning(\n new Error(`Detected multiple webpack devServer configurations, using the first one.`)\n );\n }\n devServerOptions = { ...defaultDevServerOptions, ...filteredDevServerOptions[0] };\n } else {\n devServerOptions = { ...defaultDevServerOptions, ...webpackConfiguration.devServer };\n }\n\n // Add the certificate and key to the devServerOptions if these fields don't already have values\n if (!devServerOptions.server) {\n const certificateManager: CertificateManager = new CertificateManager();\n const certificate: ICertificate = await certificateManager.ensureCertificateAsync(\n true,\n taskSession.logger.terminal\n );\n\n // Update the web socket URL to use the hostname provided by the certificate\n const clientConfiguration: TWebpackDevServer.Configuration['client'] = devServerOptions.client;\n const hostname: string | undefined = certificate.subjectAltNames?.[0];\n if (hostname && typeof clientConfiguration === 'object') {\n const { webSocketURL } = clientConfiguration;\n if (typeof webSocketURL === 'object') {\n clientConfiguration.webSocketURL = {\n ...webSocketURL,\n hostname\n };\n }\n }\n\n devServerOptions = {\n ...devServerOptions,\n server: {\n type: 'https',\n options: {\n minVersion: 'TLSv1.3',\n key: certificate.pemKey,\n cert: certificate.pemCertificate,\n ca: certificate.pemCaCertificate\n }\n }\n };\n }\n\n // Since the webpack-dev-server does not return infrastructure errors via a callback like\n // compiler.watch(...), we will need to intercept them and log them ourselves.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n compiler.hooks.infrastructureLog.tap(PLUGIN_NAME, (name: string, type: string, args: any[]) => {\n if (name === WEBPACK_DEV_MIDDLEWARE_PACKAGE_NAME && type === 'error') {\n const error: Error | undefined = args[0];\n if (error) {\n taskSession.logger.emitError(error);\n }\n }\n return true;\n });\n\n // The webpack-dev-server package has a design flaw, where merely loading its package will set the\n // WEBPACK_DEV_SERVER environment variable -- even if no APIs are accessed. This environment variable\n // causes incorrect behavior if Heft is not running in serve mode. Thus, we need to be careful to call\n // require() only if Heft is in serve mode.\n taskSession.logger.terminal.writeLine('Starting webpack-dev-server');\n const WebpackDevServer: typeof TWebpackDevServer = (await import(WEBPACK_DEV_SERVER_PACKAGE_NAME))\n .default;\n const webpackDevServer: TWebpackDevServer = new WebpackDevServer(devServerOptions, compiler);\n await webpackDevServer.start();\n } else {\n // Create the watcher. Compilation will start immediately after invoking watch().\n taskSession.logger.terminal.writeLine('Starting Webpack watcher');\n compiler.watch({}, (error?: Error | null) => {\n if (error) {\n taskSession.logger.emitError(error);\n }\n });\n }\n\n // Store the watchers to be used for suspend/resume\n this._webpackWatchers = (\n (compiler as ExtendedMultiCompiler).compilers ?? [compiler as ExtendedCompiler]\n ).map((compiler: ExtendedCompiler) => compiler.watching);\n }\n\n // Resume the compilation, wait for the compilation to complete, then suspend the watchers until the\n // next iteration. Even if there are no changes, the promise should resolve since resuming from a\n // suspended state invalidates the state of the watcher.\n taskSession.logger.terminal.writeLine('Running incremental Webpack compilation');\n for (const watcher of this._webpackWatchers) {\n watcher.resume();\n }\n await webpackCompilationDonePromise;\n for (const watcher of this._webpackWatchers) {\n watcher.suspend();\n }\n }\n\n private _validateEnvironmentVariable(taskSession: IHeftTaskSession): void {\n if (!this._isServeMode && process.env[WEBPACK_DEV_SERVER_ENV_VAR_NAME]) {\n taskSession.logger.emitWarning(\n new Error(\n `The \"${WEBPACK_DEV_SERVER_ENV_VAR_NAME}\" environment variable is set, ` +\n 'which will cause problems when webpack is not running in serve mode. ' +\n `(Did a dependency inadvertently load the \"${WEBPACK_DEV_SERVER_PACKAGE_NAME}\" package?)`\n )\n );\n }\n }\n\n private _emitErrors(logger: IScopedLogger, stats: TWebpack.Stats | TWebpack.compilation.MultiStats): void {\n if (stats.hasErrors() || stats.hasWarnings()) {\n const serializedStats: TWebpack.Stats.ToJsonOutput = stats.toJson('errors-warnings');\n\n for (const warning of serializedStats.warnings as (string | Error)[]) {\n logger.emitWarning(warning instanceof Error ? warning : new Error(warning));\n }\n\n for (const error of serializedStats.errors as (string | Error)[]) {\n logger.emitError(error instanceof Error ? error : new Error(error));\n }\n }\n }\n}\n"]}
package/lib/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export { PLUGIN_NAME as PluginName } from './Webpack4Plugin';
2
- export type { IWebpackConfigurationWithDevServer, IWebpackConfiguration, IWebpackConfigurationFnEnvironment, IWebpackPluginAccessor, IWebpackPluginAccessorHooks } from './shared';
2
+ export type { IWebpackConfigurationWithDevServer, IWebpackConfiguration, IWebpackConfigurationFnEnvironment, IWebpackPluginAccessor, IWebpackPluginAccessorHooks, IWebpackPluginAccessorParameters } from './shared';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE7D,YAAY,EACV,kCAAkC,EAClC,qBAAqB,EACrB,kCAAkC,EAClC,sBAAsB,EACtB,2BAA2B,EAC5B,MAAM,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE7D,YAAY,EACV,kCAAkC,EAClC,qBAAqB,EACrB,kCAAkC,EAClC,sBAAsB,EACtB,2BAA2B,EAC3B,gCAAgC,EACjC,MAAM,UAAU,CAAC"}
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,mDAA6D;AAApD,4GAAA,WAAW,OAAc","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nexport { PLUGIN_NAME as PluginName } from './Webpack4Plugin';\n\nexport type {\n IWebpackConfigurationWithDevServer,\n IWebpackConfiguration,\n IWebpackConfigurationFnEnvironment,\n IWebpackPluginAccessor,\n IWebpackPluginAccessorHooks\n} from './shared';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,mDAA6D;AAApD,4GAAA,WAAW,OAAc","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nexport { PLUGIN_NAME as PluginName } from './Webpack4Plugin';\n\nexport type {\n IWebpackConfigurationWithDevServer,\n IWebpackConfiguration,\n IWebpackConfigurationFnEnvironment,\n IWebpackPluginAccessor,\n IWebpackPluginAccessorHooks,\n IWebpackPluginAccessorParameters\n} from './shared';\n"]}
package/lib/shared.d.ts CHANGED
@@ -82,6 +82,15 @@ export interface IWebpackPluginAccessorHooks {
82
82
  */
83
83
  readonly onEmitStats: AsyncParallelHook<TWebpack.Stats | TWebpack.compilation.MultiStats, never, never>;
84
84
  }
85
+ /**
86
+ * @public
87
+ */
88
+ export interface IWebpackPluginAccessorParameters {
89
+ /**
90
+ * Whether or not serve mode was enabled by passing the `--serve` flag.
91
+ */
92
+ readonly isServeMode: boolean;
93
+ }
85
94
  /**
86
95
  * @public
87
96
  */
@@ -89,6 +98,10 @@ export interface IWebpackPluginAccessor {
89
98
  /**
90
99
  * Hooks that are called at various points in the Webpack plugin lifecycle.
91
100
  */
92
- hooks: IWebpackPluginAccessorHooks;
101
+ readonly hooks: IWebpackPluginAccessorHooks;
102
+ /**
103
+ * Parameters that are provided by the Webpack plugin.
104
+ */
105
+ readonly parameters: IWebpackPluginAccessorParameters;
93
106
  }
94
107
  //# sourceMappingURL=shared.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../src/shared.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,QAAQ,MAAM,SAAS,CAAC;AAEzC,OAAO,QAAQ,SAAS,CAAC;IACvB,KAAY,UAAU,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC;IACzD,KAAY,YAAY,GAAG,OAAO,CAAC;IACnC,KAAY,gBAAgB,GAAG,QAAQ,CAAC,WAAW,CAAC,WAAW,CAAC;IAGhE,UAAiB,QAAQ;QACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB;CACF;AACD,OAAO,KAAK,EAAE,aAAa,IAAI,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AACzF,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AACvF,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAE3E;;;;;;GAMG;AACH,MAAM,WAAW,kCAAkC;IACjD;;;OAGG;IACH,IAAI,EAAE,OAAO,CAAC;IACd;;;OAGG;IACH,UAAU,EAAE,OAAO,CAAC;IAGpB;;OAEG;IACH,WAAW,EAAE,gBAAgB,CAAC;IAC9B;;OAEG;IACH,iBAAiB,EAAE,iBAAiB,CAAC;IACrC;;OAEG;IACH,OAAO,EAAE,OAAO,QAAQ,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,kCAAmC,SAAQ,QAAQ,CAAC,aAAa;IAChF,SAAS,CAAC,EAAE,6BAA6B,CAAC;CAC3C;AAED;;GAEG;AACH,oBAAY,qBAAqB,GAAG,kCAA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,CAAC;IAC5C;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,gCAAgC,CAAC;CACvD"}
package/lib/shared.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"shared.js","sourceRoot":"","sources":["../src/shared.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport type * as TWebpack from 'webpack';\n// Compensate for webpack-dev-server referencing constructs from webpack 5\ndeclare module 'webpack' {\n export type MultiStats = TWebpack.compilation.MultiStats;\n export type StatsOptions = unknown;\n export type StatsCompilation = TWebpack.compilation.Compilation;\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n export interface Compiler {\n watching?: unknown;\n }\n}\nimport type { Configuration as WebpackDevServerConfiguration } from 'webpack-dev-server';\nimport type { AsyncParallelHook, AsyncSeriesBailHook, AsyncSeriesHook } from 'tapable';\nimport type { IHeftTaskSession, HeftConfiguration } from '@rushstack/heft';\n\n/**\n * The environment passed into the Webpack configuration function. Loosely based\n * on the default Webpack environment options, specified here:\n * https://webpack.js.org/api/cli/#environment-options\n *\n * @public\n */\nexport interface IWebpackConfigurationFnEnvironment {\n /**\n * Whether or not the run is in production mode. Synonym of\n * IWebpackConfigurationFnEnvironment.production.\n */\n prod: boolean;\n /**\n * Whether or not the run is in production mode. Synonym of\n * IWebpackConfigurationFnEnvironment.prod.\n */\n production: boolean;\n\n // Non-standard environment options\n /**\n * The task session provided to the plugin.\n */\n taskSession: IHeftTaskSession;\n /**\n * The Heft configuration provided to the plugin.\n */\n heftConfiguration: HeftConfiguration;\n /**\n * The resolved Webpack package.\n */\n webpack: typeof TWebpack;\n}\n\n/**\n * @public\n */\nexport interface IWebpackConfigurationWithDevServer extends TWebpack.Configuration {\n devServer?: WebpackDevServerConfiguration;\n}\n\n/**\n * @public\n */\nexport type IWebpackConfiguration = IWebpackConfigurationWithDevServer | IWebpackConfigurationWithDevServer[];\n\n/**\n * @public\n */\nexport interface IWebpackPluginAccessorHooks {\n /**\n * A hook that allows for loading custom configurations used by the Webpack\n * plugin. If a webpack configuration is provided, this will be populated automatically\n * with the exports of the config file. If a webpack configuration is not provided,\n * one will be loaded by the Webpack plugin.\n *\n * @remarks\n * Tapable event handlers can return `false` instead of `undefined` to suppress\n * other handlers from creating a configuration object, and prevent webpack from running.\n */\n readonly onLoadConfiguration: AsyncSeriesBailHook<never, never, never, IWebpackConfiguration | false>;\n /**\n * A hook that allows for modification of the loaded configuration used by the Webpack\n * plugin. If no configuration was loaded, this hook will not be called.\n */\n readonly onConfigure: AsyncSeriesHook<IWebpackConfiguration, never, never>;\n /**\n * A hook that provides the finalized configuration that will be used by Webpack.\n * If no configuration was loaded, this hook will not be called.\n */\n readonly onAfterConfigure: AsyncParallelHook<IWebpackConfiguration, never, never>;\n /**\n * A hook that provides the stats output from Webpack. If no configuration is loaded,\n * this hook will not be called.\n */\n readonly onEmitStats: AsyncParallelHook<TWebpack.Stats | TWebpack.compilation.MultiStats, never, never>;\n}\n\n/**\n * @public\n */\nexport interface IWebpackPluginAccessor {\n /**\n * Hooks that are called at various points in the Webpack plugin lifecycle.\n */\n hooks: IWebpackPluginAccessorHooks;\n}\n"]}
1
+ {"version":3,"file":"shared.js","sourceRoot":"","sources":["../src/shared.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport type * as TWebpack from 'webpack';\n// Compensate for webpack-dev-server referencing constructs from webpack 5\ndeclare module 'webpack' {\n export type MultiStats = TWebpack.compilation.MultiStats;\n export type StatsOptions = unknown;\n export type StatsCompilation = TWebpack.compilation.Compilation;\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n export interface Compiler {\n watching?: unknown;\n }\n}\nimport type { Configuration as WebpackDevServerConfiguration } from 'webpack-dev-server';\nimport type { AsyncParallelHook, AsyncSeriesBailHook, AsyncSeriesHook } from 'tapable';\nimport type { IHeftTaskSession, HeftConfiguration } from '@rushstack/heft';\n\n/**\n * The environment passed into the Webpack configuration function. Loosely based\n * on the default Webpack environment options, specified here:\n * https://webpack.js.org/api/cli/#environment-options\n *\n * @public\n */\nexport interface IWebpackConfigurationFnEnvironment {\n /**\n * Whether or not the run is in production mode. Synonym of\n * IWebpackConfigurationFnEnvironment.production.\n */\n prod: boolean;\n /**\n * Whether or not the run is in production mode. Synonym of\n * IWebpackConfigurationFnEnvironment.prod.\n */\n production: boolean;\n\n // Non-standard environment options\n /**\n * The task session provided to the plugin.\n */\n taskSession: IHeftTaskSession;\n /**\n * The Heft configuration provided to the plugin.\n */\n heftConfiguration: HeftConfiguration;\n /**\n * The resolved Webpack package.\n */\n webpack: typeof TWebpack;\n}\n\n/**\n * @public\n */\nexport interface IWebpackConfigurationWithDevServer extends TWebpack.Configuration {\n devServer?: WebpackDevServerConfiguration;\n}\n\n/**\n * @public\n */\nexport type IWebpackConfiguration = IWebpackConfigurationWithDevServer | IWebpackConfigurationWithDevServer[];\n\n/**\n * @public\n */\nexport interface IWebpackPluginAccessorHooks {\n /**\n * A hook that allows for loading custom configurations used by the Webpack\n * plugin. If a webpack configuration is provided, this will be populated automatically\n * with the exports of the config file. If a webpack configuration is not provided,\n * one will be loaded by the Webpack plugin.\n *\n * @remarks\n * Tapable event handlers can return `false` instead of `undefined` to suppress\n * other handlers from creating a configuration object, and prevent webpack from running.\n */\n readonly onLoadConfiguration: AsyncSeriesBailHook<never, never, never, IWebpackConfiguration | false>;\n /**\n * A hook that allows for modification of the loaded configuration used by the Webpack\n * plugin. If no configuration was loaded, this hook will not be called.\n */\n readonly onConfigure: AsyncSeriesHook<IWebpackConfiguration, never, never>;\n /**\n * A hook that provides the finalized configuration that will be used by Webpack.\n * If no configuration was loaded, this hook will not be called.\n */\n readonly onAfterConfigure: AsyncParallelHook<IWebpackConfiguration, never, never>;\n /**\n * A hook that provides the stats output from Webpack. If no configuration is loaded,\n * this hook will not be called.\n */\n readonly onEmitStats: AsyncParallelHook<TWebpack.Stats | TWebpack.compilation.MultiStats, never, never>;\n}\n\n/**\n * @public\n */\nexport interface IWebpackPluginAccessorParameters {\n /**\n * Whether or not serve mode was enabled by passing the `--serve` flag.\n */\n readonly isServeMode: boolean;\n}\n\n/**\n * @public\n */\nexport interface IWebpackPluginAccessor {\n /**\n * Hooks that are called at various points in the Webpack plugin lifecycle.\n */\n readonly hooks: IWebpackPluginAccessorHooks;\n /**\n * Parameters that are provided by the Webpack plugin.\n */\n readonly parameters: IWebpackPluginAccessorParameters;\n}\n"]}
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.31.2"
8
+ "packageVersion": "7.33.6"
9
9
  }
10
10
  ]
11
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rushstack/heft-webpack4-plugin",
3
- "version": "0.6.0-dev.1",
3
+ "version": "0.6.0-rc.0",
4
4
  "description": "Heft plugin for Webpack 4",
5
5
  "repository": {
6
6
  "type": "git",
@@ -17,21 +17,21 @@
17
17
  }
18
18
  },
19
19
  "peerDependencies": {
20
- "@rushstack/heft": "^0.48.0-dev.0",
20
+ "@rushstack/heft": "^0.49.0-rc.0",
21
21
  "@types/webpack": "^4",
22
22
  "webpack": "~4.44.2"
23
23
  },
24
24
  "dependencies": {
25
- "@rushstack/debug-certificate-manager": "1.1.76",
26
- "@rushstack/node-core-library": "3.52.0",
25
+ "@rushstack/debug-certificate-manager": "1.2.4",
26
+ "@rushstack/node-core-library": "3.53.2",
27
27
  "@types/tapable": "1.0.6",
28
28
  "tapable": "1.1.3",
29
29
  "webpack-dev-server": "~4.9.3"
30
30
  },
31
31
  "devDependencies": {
32
- "@rushstack/eslint-config": "3.0.1",
33
- "@rushstack/heft-node-rig": "1.11.0-dev.1",
34
- "@rushstack/heft": "0.48.0-dev.1",
32
+ "@rushstack/eslint-config": "3.1.1",
33
+ "@rushstack/heft-node-rig": "1.12.0-rc.0",
34
+ "@rushstack/heft": "0.49.0-rc.0",
35
35
  "@types/node": "12.20.24",
36
36
  "@types/webpack": "4.41.32",
37
37
  "webpack": "~4.44.2"