jspm-loader-css icon indicating copy to clipboard operation
jspm-loader-css copied to clipboard

Added separateCSS support

Open chancezeus opened this issue 9 years ago • 1 comments

I added support for the separateCSS option available in "plugin-css" (it is actually an almost literal copy of their code). I also started working on sourcemap support but did not yet have time to finish so that part is commented out for the moment, but I thought I'd share the current version anyway since the separateCSS feature is a nice one to have when bundling your app (and it is easy to copy/paste it in the current version of the plugin).

I also used the 'node-cssnano' import instead of 'cssnano' since the latter is auto-created when you do "browser": {"cssnano": false} and the normal cssnano import is (in that case) going to redirect to @empty (or it should be once jspm 0.17 gets fixed, in my install it still get's linked to npm:cssnano which results in JS errors when running in the browser).

chancezeus avatar Oct 26 '16 16:10 chancezeus

Hey, thanks for the PR. I will try to check it out ASAP, but a little busy with pre-Halloween stuff right now.

Some initial thoughts having not ran the code:

  • Pretty confident I've already explored the browserify configuration route. It would work alright locally, but wouldn't properly setup once the plugin is published and people are consuming it. You can see my thoughts here: https://github.com/jspm/jspm-cli/issues/1611 and here https://github.com/jspm/npm/issues/129 -- I think that if you look through the release history for this plugin you can find a version which uses the exact configuration you're suggesting. Try pulling it down from NPM and see if it works for you. Maybe things have changed.
  • I spoke with @guybedford about fixing the issue and he suggested against using the browserify route. The support for browserify / node-x stuff is only temporary and will be removed in a future release of jspm.
  • There's a bunch of commented out code in your code. This PR would need to be cleaned up before I could consider merging it.

MeoMix avatar Oct 26 '16 16:10 MeoMix