From e47d5e82154c13fff66b11c48639f3a66f331e6d Mon Sep 17 00:00:00 2001 From: Zn4rK Date: Thu, 23 Nov 2023 14:35:53 +0100 Subject: [PATCH] add request property to NavitaDependency --- .changeset/orange-foxes-develop.md | 5 +++++ examples/with-next-app-dir/src/app/edge/page.tsx | 15 +++++++++++++++ .../webpack-plugin/src/getNavitaDependency.ts | 4 ++++ 3 files changed, 24 insertions(+) create mode 100644 .changeset/orange-foxes-develop.md create mode 100644 examples/with-next-app-dir/src/app/edge/page.tsx diff --git a/.changeset/orange-foxes-develop.md b/.changeset/orange-foxes-develop.md new file mode 100644 index 0000000..3d1cba7 --- /dev/null +++ b/.changeset/orange-foxes-develop.md @@ -0,0 +1,5 @@ +--- +'@navita/webpack-plugin': minor +--- + +fix request property on navita dependency diff --git a/examples/with-next-app-dir/src/app/edge/page.tsx b/examples/with-next-app-dir/src/app/edge/page.tsx new file mode 100644 index 0000000..aafba2b --- /dev/null +++ b/examples/with-next-app-dir/src/app/edge/page.tsx @@ -0,0 +1,15 @@ +import { style } from '@navita/css'; + +const x = style({ + background: 'purple', +}); + +export default function Edge() { + return ( +
+
Edge.
+
+ ); +} + +export const runtime = 'edge'; diff --git a/packages/webpack-plugin/src/getNavitaDependency.ts b/packages/webpack-plugin/src/getNavitaDependency.ts index d11c840..455d29c 100644 --- a/packages/webpack-plugin/src/getNavitaDependency.ts +++ b/packages/webpack-plugin/src/getNavitaDependency.ts @@ -23,6 +23,10 @@ function createNavitaDependency(webpack: Compiler['webpack']) { super(); } + get request() { + return this.issuerPath; + } + getResourceIdentifier() { return `css-module-${this.issuerPath}-${this.cssHash}`; }