@ondrejsevcik wrote:
Hi, I’m looking at ember-elm (Elm to JS transpiler) and I’m facing an issue where the compiled code is imported differently in different environments.
The Elm compiler takes all
.elm
files and outputs one.js
file. This file is then correctly picked up by broccoli build system. But the problem is how it is glued into the resulting bundle.When imported in
dummy
app, it is wrapped indefine
fn.define('dummy/elm-modules', ['export'], function(_export) { // export is defined! });
but when imported in
app
, it is imported asdefine('app-name/elm-modules', [], function() { // note the missing export })
and when imported without
export default ...
it doesn’t wrap it indefine
at all.I’ve tried to write some hacky wrapper around it to outsmart that, but it’s not working.
What’s the best way to handle this so it works for addons, engines, dummy apps and also regular apps? Plus ideally caching works as well.
Thanks for your help.
Posts: 1
Participants: 1