Skip to content

Commit

Permalink
fix: Fix assets paths not resolving to the correct location. (#187)
Browse files Browse the repository at this point in the history
* Test no bundle.

* Test bundle.

* Use absolute ID.

* Update hashes.

* Try resolve.

* Hrmm.

* Fix imports.
  • Loading branch information
milesj authored Mar 8, 2023
1 parent 62786fb commit fc83a17
Show file tree
Hide file tree
Showing 4 changed files with 2,389 additions and 482 deletions.
9 changes: 7 additions & 2 deletions packages/packemon/src/rollup/plugins/copyAndRefAssets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,14 @@ export function copyAndRefAssets({ dir }: CopyAssetsOptions): Plugin {
},

// Find assets and mark as external
resolveId(source) {
resolveId(source, importer) {
if (isAsset(source)) {
return { id: source, external: true };
if (source.startsWith('.')) {
return { id: path.join(path.dirname(importer!), source), external: true };
}

// Ignore files coming from node modules
return false;
}

return null;
Expand Down
Loading

0 comments on commit fc83a17

Please sign in to comment.