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

Add script names for scalajs-bunlder bundles #17

Merged
merged 1 commit into from
Apr 1, 2018
Merged

Add script names for scalajs-bunlder bundles #17

merged 1 commit into from
Apr 1, 2018

Conversation

njouanin
Copy link
Contributor

@njouanin njouanin commented Jul 8, 2017

Here is a proposition to manage scripts generated by scalajs-bundler.

@SkyWriter
Copy link

@vmunier It would be really helpful if you got a minute to review and possibly merge this. Thanks for your hard work! 👊

@vmunier vmunier merged commit c77f502 into vmunier:master Apr 1, 2018
@vmunier
Copy link
Owner

vmunier commented Apr 1, 2018

I completely forgot about this issue... PR merged, thank you both! I will release a new version when bintray is back up.

@vmunier
Copy link
Owner

vmunier commented Apr 4, 2018

scalajs-scripts v1.1.2 has just been published to Maven Central.

@SkyWriter
Copy link

You're the man! 💪 Thanks!

rtyley added a commit to rtyley/scalajs-scripts that referenced this pull request Aug 3, 2019
When using the scalajs-bundler sbt plugin:

https://github.com/scalacenter/scalajs-bundler

...and deploying to Heroku, I've had problems with the `project-opt.js`
artifact being selected over the `project-opt-bundle.js` artifact which
is required - I _think_ `-bundle` artifacts should be preferred -
`selectScript.scala.html` only selects one, so it should be the `-bundle`
one.

This follows on from vmunier#17

Until this fix is released, a workaround for this issue is to hack the
value of the `resourceExists` function sent to `selectScript.scala.html`,
eg adding `&& name.contains("-bundle")`:

```
@scalajs.html.scripts(
    buildinfo.BuildInfo.name,
    routes.Assets.versioned(_).toString,
    name => getClass.getResource(s"/public/$name") != null && name.contains("-bundle")
)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants