Skip to content

Commit

Permalink
Merge pull request #215 from tokens-studio/fix/webpack
Browse files Browse the repository at this point in the history
fix: webpackIgnore statement
  • Loading branch information
jorenbroekema authored Oct 27, 2023
2 parents 111f443 + a3ad58b commit 4a78e0c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/dirty-monkeys-fetch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@tokens-studio/sd-transforms': patch
---

Fix the webpackIgnore statement to use single \*. For NextJS integration (webpack).
2 changes: 1 addition & 1 deletion src/registerTransforms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 4a78e0c

Please sign in to comment.