Skip to content

Commit d7e550e

Browse files
committed
fix(cmd-api-server): plugin imports via static config (env,cli,file)
Depends on webpack/webpack#11316 This has no real effect until the PR above is merged and releaed on Webpack (and then we upgrade to that release for the builds) How this fix works is explained in the linked PR in greater detail. Signed-off-by: Peter Somogyvari <[email protected]>
1 parent 8734642 commit d7e550e

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

packages/cactus-cmd-api-server/src/main/typescript/api-server.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,16 @@ export class ApiServer {
161161
const registry = new PluginRegistry({ plugins: [] });
162162
const { logLevel } = this.options.config;
163163
this.log.info(`Instantiated empty registry, invoking plugin factories...`);
164+
164165
for (const pluginImport of this.options.config.plugins) {
165166
const { packageName, options } = pluginImport;
166167
this.log.info(`Creating plugin from package: ${packageName}`, options);
167168
const pluginOptions = { ...options, logLevel, pluginRegistry: registry };
168-
const { createPluginFactory } = await import(packageName);
169+
170+
const {
171+
createPluginFactory,
172+
} = require(/* webpackIgnore: true */ packageName);
173+
169174
const pluginFactory: PluginFactory<
170175
ICactusPlugin,
171176
any

tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
2323
// "composite": true, /* Enable project compilation */
2424
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
25-
// "removeComments": true, /* Do not emit comments to output. */
25+
"removeComments": false, /* Do not emit comments to output. */
2626
// "noEmit": true, /* Do not emit outputs. */
2727
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
2828
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */

0 commit comments

Comments
 (0)