From a3ad58b9d3fbd72ddb7c9803ce45065d883b169a Mon Sep 17 00:00:00 2001 From: jorenbroekema Date: Fri, 27 Oct 2023 10:36:12 +0200 Subject: [PATCH] fix: webpackIgnore statement --- .changeset/dirty-monkeys-fetch.md | 5 +++++ src/registerTransforms.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/dirty-monkeys-fetch.md diff --git a/.changeset/dirty-monkeys-fetch.md b/.changeset/dirty-monkeys-fetch.md new file mode 100644 index 0000000..65ca71e --- /dev/null +++ b/.changeset/dirty-monkeys-fetch.md @@ -0,0 +1,5 @@ +--- +'@tokens-studio/sd-transforms': patch +--- + +Fix the webpackIgnore statement to use single \*. For NextJS integration (webpack). diff --git a/src/registerTransforms.ts b/src/registerTransforms.ts index bcd7a7c..d68c673 100644 --- a/src/registerTransforms.ts +++ b/src/registerTransforms.ts @@ -45,7 +45,7 @@ export async function registerTransforms(sd: Core, transformOpts?: TransformOpti // NodeJS env and no passed SD? let's register on our installed SD // We're in ESM, but style-dictionary is CJS only, so we need module.createRequire if (!isBrowser && _sd === undefined) { - const module = await import(/** webpackIgnore: true */ 'node:module'); + const module = await import(/* webpackIgnore: true */ 'node:module'); const mod = module.default; const require = mod.createRequire(import.meta.url); _sd = require('style-dictionary');