Closed marjan-georgiev closed 9 years ago
A workaround for bundled modules is to use System.import instead of import:
System.import('common/components/select.css!');
Are you including the full configuration file before the bundle? CSS will load as long as you aren't using bundle-sfx.
I believe we are: https://github.com/amcdnl/systemjs-test/blob/master/index.html#L32
@guybedford @marjan-georgiev we are including it in our custom bundle script that uses system builder too - https://github.com/amcdnl/systemjs-test/blob/master/gulpfile.js#L252
Is there a System.register("common/components/select.css!", ...)
in the bundle? Also is there a System.register("plugin/css", ...)
in the bundle?
You should have just the plugin, and not the css itself defined.
There is no System.register("common/components/select.css!") System.register("bower_components/plugin-css/css", ...) is in app/app.js.
Here are the two relevant files after the build: https://gist.github.com/marjan-georgiev/998ab23fa77d8a675f09
@marjan-georgiev I think this line might be your problem - https://gist.github.com/marjan-georgiev/998ab23fa77d8a675f09#file-app-js-L7.
The CSS file itself is not in the bundle, so you shouldn't include it in the bundles configuration.
That was it! Thank you sir!
If a module imports a CSS file, and that module is bundled during the build process, the CSS file will not be imported.
Example:
src/common/components/select.js
after
gulp build
, that module is bundled and ends up into dist/bundles/2-3.js:However, the CSS file is not loaded in the browser.
This works for non-bundled modules.