systemjs / plugin-css

CSS loader plugin
MIT License
92 stars 60 forks source link

Broken @import errors #96

Closed mrcasado closed 8 years ago

mrcasado commented 8 years ago

Since upgrading from 0.1.23 to 0.1.25 'Broken @import declaration of" when bundling. I had to go back to 0.1.23.

guybedford commented 8 years ago

Can you share a test case? Are you setting the rootURL? On Wed, 27 Jul 2016 at 17:52, Alex notifications@github.com wrote:

Since upgrading from 0.1.23 to 0.1.25 'Broken @import https://github.com/import declaration of" when bundling. I had to go back to 0.1.23.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/systemjs/plugin-css/issues/96, or mute the thread https://github.com/notifications/unsubscribe-auth/AAkiyjn5sqGywzMJ1NRJEXlmTE0EPf4Mks5qZ37LgaJpZM4JWV0a .

mrcasado commented 8 years ago

Sure.

This is how the bundle task looks: ` gulp.task('bundle', ['ensure-bundle'], function (cb) {

     var builder = new Builder();
     builder.loadConfig(options.config)
        .then(function() {
           builder.config({
              buildCSS: true,
              separateCSS: true
           });
           return builder.buildStatic(options.entryJs, options.outputJs);
        })
        .then(function() {
           gutil.log("Output " + options.outputJs + ", " + options.outputCss);
           cb();
        })
        .catch(function(err) {
           gutil.log('Build error:');
           gutil.log(err);
           cb(err);
        });
  });`

I'm not setting rootURL.

Then I got in every module(folder) of the project an index.css file with all the css imports like for example ui/controls/src/styles/index.css or ui/crm/src/styles/index.css : @import "styles/component/event-description.css"; @import "styles/module/recent-events-widget.css";

When bundling using version 0.1.25 I get the following errors: 'Broken @import declaration of "crm/src/styles/component/event-description.css"', 'Broken @import declaration of "crm/src/styles/module/recent-events-widget.css"',

Do I need to set the rootURL at all?

Thanks Alex

guybedford commented 8 years ago

Thanks, sure I'll test this out as soon as I can.

So it sounds like it is normalizing to crm/src/styles/module/recent-events-widget.css which for some reason is invalid? What do you think the correct resolved path should be?

guybedford commented 8 years ago

I've just posted out an update in 0.1.26, including some normalization adjustments. If that doesn't fix it for you please let me know, and I'll have another look at this.