CanopyTax/webpack-system-register

Does not play well with other plugins?

Opened this issue · 3 comments

I'm having a hard time using this plugin along with extract-text-webpack-plugin (for dealing with CSS files) and html-webpack-plugin (for dealing with HTML files).

In both cases I get an error at build/compile time ReferenceError: System is not defined.

I suspect that what is happening is that the CSS and HTML files are getting wrapped in a System.register() call before they go through the other plugins.... but I'm having a hard time verifying that that is the case.

I'll create an example and add it to the bottom this issue.

Yeah I have noticed this too. I think it is because of the way that we are modifying the bundle's code. My guess is that we're hooking into the wrong webpack hook, or something like that. See https://github.com/CanopyTax/feature-toggles-ui#overrides and https://github.com/CanopyTax/webpack-system-register/blob/master/src/webpack-system-register.js#L114-L115 for more info on how we're doing that.

I would love to update the code to not use the seal hook in webpack, but I'm just not sure what to change it to.

I have the same issue, any news of that? @morficus how did you deal with it finally?