Skip to content

Commit

Permalink
fix: fix build script (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
taishinaritomi committed Aug 13, 2023
1 parent 796d3a9 commit aeefa33
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/afraid-elephants-think.md
@@ -0,0 +1,5 @@
---
"excss": patch
---

fix: fix build script
11 changes: 6 additions & 5 deletions packages/excss/scripts/build.ts
Expand Up @@ -57,13 +57,14 @@ async function js() {
setup: (build) => {
build.onResolve({ filter: /dist\/_wasm/ }, (args) => {
if (args.importer) {
const resolvedPath = path.join(args.resolveDir, args.path);
const originalPath = `${resolvedPath}.js`;
const resolvedPath = path.relative(
path.join(process.cwd(), entryPoint),
path.join(args.resolveDir, `${args.path}.js`),
);

return {
external: true,
path: fs.existsSync(originalPath)
? originalPath
: resolvedPath,
path: resolvedPath.replace("../", ""),
};
}
});
Expand Down

0 comments on commit aeefa33

Please sign in to comment.