Skip to content

Commit

Permalink
(wmr) Fix double quotes imports with bundle-plugin (#409)
Browse files Browse the repository at this point in the history
* (wmr) Fix double quotes imports with bundle-plugin

JavaScript imports can use either single or double quotes:

```js
import 'bundle:./file';
import "bundle:./file";
```

* fixup! (wmr) Fix double quotes imports with bundle-plugin
  • Loading branch information
aduh95 authored Mar 9, 2021
1 parent cc0d260 commit 2102ffb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/hot-squids-learn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'wmr': patch
---

Fix double quotes imports with bundle-plugin
2 changes: 1 addition & 1 deletion packages/wmr/src/plugins/bundle-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function bundlePlugin({ cwd = '.', inline } = {}) {
if (inline) {
const url = '/' + relative(cwd, resolved.id).replace(/^\./, '');
return {
id: `data:text/javascript,export default${JSON.stringify(url)}`.replace(/#/g, '%23'),
id: `data:text/javascript,export default${encodeURIComponent(JSON.stringify(url))}`,
external: true
};
}
Expand Down

0 comments on commit 2102ffb

Please sign in to comment.