steal-tools
steal-tools copied to clipboard
slim loader not working properly with canJS 5, ES modules and multimain
i give the slim loader a try and want to use it in my multimain app, we had an issue with multimain #823 and @m-mujica solved it.
but now i have a more complex app and it the slim-loader breaks.
the problem are shared dependencies.
i created an example app.
- https://github.com/pYr0x/slim-multimain/tree/working : a simple dependency called "_shared.js" is used in both mains. after build it works like expected
- https://github.com/pYr0x/slim-multimain/tree/not-working : same principle, but now i added canjs5 to it. in
_shared.js
i importimport {ajax} from "can";
and in second main i importimport {DefineMap} from "can";
. the apps breaks.main1.js:107 Uncaught (in promise) TypeError: Cannot read property 'call' of undefined
. Moduls6
is not inmodulesMap
.
it would be nice if this problem will be solved. slim loader runs as twice as fast as steal.
Yeah, I'll see if I can fix this today.
There's a couple of bugs here at least:
- Setting
treeShaking: false
in the BuildOptions does not turn off the client-side tree-shaking. @pYr0x as a stop-gap you can add"treeShaking": false
in your package.jsonsteal
config and it will disable it in both places, and this will work. - The tree-shaking is removing a module, can/core I believe. Looking into why.
https://github.com/stealjs/steal-tools/issues/1058 <- First bug.
@matthewp any idea when the second bug will be fixed?
I must have forgotten about this. I'll add it to my sprint