Skip to content

Commit

Permalink
fix(webpack): infer serve-static target correctly from plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysoo committed Nov 30, 2023
1 parent 2d529b1 commit 58b4c35
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/webpack/src/plugins/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { calculateHashForCreateNodes } from '@nx/devkit/src/utils/calculate-hash
export interface WebpackPluginOptions {
buildTargetName?: string;
serveTargetName?: string;
staticServeTargetName?: string;
serveStaticTargetName?: string;
previewTargetName?: string;
}

Expand Down Expand Up @@ -59,7 +59,7 @@ export const createNodes: CreateNodes<WebpackPluginOptions> = [
options ??= {};
options.buildTargetName ??= 'build';
options.serveTargetName ??= 'serve';
options.staticServeTargetName ??= 'static-serve';
options.serveStaticTargetName ??= 'serve-static';
options.previewTargetName ??= 'preview';

const projectRoot = dirname(configFilePath);
Expand Down Expand Up @@ -175,10 +175,10 @@ async function createWebpackTargets(
},
};

targets[options.staticServeTargetName] = {
targets[options.serveStaticTargetName] = {
executor: '@nx/web:file-server',
options: {
buildTarget: `${projectRoot}:${options.buildTargetName}`,
buildTarget: options.buildTargetName,
},
};

Expand Down

0 comments on commit 58b4c35

Please sign in to comment.