systemjs / plugin-css

CSS loader plugin
MIT License
92 stars 60 forks source link

Bundling not working #53

Closed letmaik closed 9 years ago

letmaik commented 9 years ago

I'm sure I'm doing something stupid but I just can't see it.

I have "css": "github:systemjs/plugin-css@^0.1.13", in my deps and I include some css files here and there, e.g. import 'leaflet/dist/leaflet.css!'.

When I run jspm bundle app/main --inject (same with bundle-sfx) it creates the bundled js but the CSS is not bundled and when I run the app it tries to request css files from the jspm_packages/ folder hierarchy. I haven't set any css-related options in the package.json as the defaults seem to be enough (?).

Apart from that, what happens with images referenced from CSS files? In the end, what I want is a single command that creates the minimum set of files to run my app and that I have to deploy.

guybedford commented 9 years ago

Did you manage to sort this out?

letmaik commented 9 years ago

I haven't tried to solve it to be honest as it's not critical for me yet.

f15gdsy commented 9 years ago

Also cannot see css file after using 'bundle-sfx' command to bundle.

In config.js I set:

separateCSS: true,
buildCSS: false,

It works fine using System.import('bundle.js') But using bundle-sfx command, the css is not generated.

letmaik commented 9 years ago

Just tried it again as I needed it and it works. I installed "css" as jspm dependency, and "clean-css" as devDependency. I didn't configure anything like "separateCSS" or "buildCSS", I just invoke "jspm bundle-sfx" with the usual options and it works. @f15gdsy Try again with newest versions, and if it doesn't work it's probably related to the config properties you use. Maybe create a more specialised issue for that.

emigre commented 8 years ago

When building a self-executing bundle, it seems that there are no external calls for the CSS files.

When building a normal bundle, even if you include the CSS during the bundling, it seems that there will be calls for the CSS files anyway, and they will cause some 404 errors if you have removed the files.

I'm not sure if this is a bug or is just how it is supposed to work.

It looks weird to me as it is making requests for stylesheets that already have been included in the bundle.

johnste commented 8 years ago

I'm having the same issues as @Emigre mentioned above. My separate css file is built as expected, but the unbundled css files are still requested (results in 404).

Not sure if it's simply a bug or if I'm doing something wrong.