Skip to content

'gulp task sample' throws error on CSS due to angularFilesort #8

Open

Description

@AmitTeli

The gulpfile.js generated, crashes on gulp serve, if the src contains some style.css.
The error is

events.js:160
throw er; // Unhandled 'error' event
^
Error: Error in parsing: "style.css", Line 1: Unexpected token .

I found that following line in the sample task is the culprit,

var files = gulp.src(['src/**/*.js', 'src/**/*.css', 'src/**/*.less', '.tmp/dist/*.js'])
                  .pipe($.if('*.js', $.angularFilesort()));

It invokes $.angular even on CSS.
This exists even if published widgets like adf-widget-clock
I have made following change and it works.

  var files = gulp.src(['src/**/*.js', '.tmp/dist/*.js'])
                  .pipe($.if('*.js', $.angularFilesort()));

  files.push(gulp.src(['src/**/*.css', 'src/**/*.less']));

Hope this post helps for rectification and someone facing the same issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions