Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: rollup-hbs-plugin add resolveId hook #1171

Merged
merged 2 commits into from
Mar 31, 2022

Conversation

wondersloth
Copy link
Contributor

  • In the load() hook, id isn't a valid property in the returned object.
  • This assumed that a resolution was created for the intermediate
    file *.hbs.js file.
  • This created an issue where a babel plugin could not transform
    *.hbs.js files.
  • Added resolveId() hook to create a resolution for *.hbs to *.hbs.js file.

- In the `load()` hook, `id` isn't a valid property in the returned object.
- This assumed that a resolution was created for the intermediate
  file `*.hbs.js` file.
- This created an issue where a babel plugin could not transform
  `*.hbs.js` files.
- Added `resolveId()` hook to create a resolution for `*.hbs` to `*.hbs.js` file.
Copy link
Collaborator

@rwjblue rwjblue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this @wondersloth!

@ef4 / @NullVoxPopuli - The issue that @wondersloth is fixing here is the root cause of why .hbs files themselves aren't going through babel transpilation (rollup-plugin-babel only looks at .js files, load isn't allowed to return a new id, so babel was just skipping these .hbs files completely).

packages/addon-dev/src/rollup-hbs-plugin.ts Outdated Show resolved Hide resolved
packages/addon-dev/src/rollup-hbs-plugin.ts Outdated Show resolved Hide resolved
@ef4 ef4 merged commit b3fbd4b into embroider-build:main Mar 31, 2022
@rwjblue rwjblue added the bug Something isn't working label Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants