Skip to content

Commit 942875a

Browse files
committed
PR feedback: Suppress configureWebpack() only when "--sst" is specified
1 parent a0bbf54 commit 942875a

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

heft-plugins/heft-serverless-stack-plugin/src/ServerlessStackPlugin.ts

+9-7
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,15 @@ export class ServerlessStackPlugin implements IHeftPlugin<IServerlessStackPlugin
8484

8585
heftSession.hooks.build.tap(PLUGIN_NAME, (build: IBuildStageContext) => {
8686
build.hooks.bundle.tap(PLUGIN_NAME, (bundle: IBundleSubstage) => {
87-
bundle.hooks.configureWebpack.tap(
88-
{ name: PLUGIN_NAME, stage: Number.MAX_SAFE_INTEGER },
89-
(webpackConfiguration: unknown) => {
90-
// Discard Webpack's configuration to prevent Webpack from running
91-
return null;
92-
}
93-
);
87+
if (!sstParameter.value) {
88+
bundle.hooks.configureWebpack.tap(
89+
{ name: PLUGIN_NAME, stage: Number.MAX_SAFE_INTEGER },
90+
(webpackConfiguration: unknown) => {
91+
// Discard Webpack's configuration to prevent Webpack from running
92+
return null;
93+
}
94+
);
95+
}
9496

9597
bundle.hooks.run.tapPromise(PLUGIN_NAME, async () => {
9698
if (!sstParameter.value) {

0 commit comments

Comments
 (0)