Giter Site home page Giter Site logo

Comments (7)

jwvdiermen avatar jwvdiermen commented on July 21, 2024

Can you please be more specific or give an example of the issue you're having which I can reproduce?

from grunt-include-source.

edgar0011 avatar edgar0011 commented on July 21, 2024

html source:

<!-- include: "type": "js", "files": "bower/angular/**/*.js" -->
<!-- /include -->

<!-- include: "type": "js", "files": "bower/**/*.js" -->
<!-- /include -->

html result:

<!-- include: "type": "js", "files": "bower/angular/**/*.js" -->
<script src="bower/angular/angular.js"></script>
<!-- /include -->

<!-- include: "type": "js", "files": "bower/**/*.js" -->
<script src="bower/angular-animate/angular-animate.js"></script>
<script src="bower/angular-bootstrap/ui-bootstrap-tpls.js"></script>
<script src="bower/angular-cookies/angular-cookies.js"></script>
<script src="bower/angular-dynamic-locale/src/tmhDynamicLocale.js"></script>
<script src="bower/angular-local-storage/dist/angular-local-storage.js"></script>
<script src="bower/angular-resource/angular-resource.js"></script>
<script src="bower/angular-sanitize/angular-sanitize.js"></script>
<script src="bower/angular-translate-loader-partial/angular-translate-loader-partial.js"></script>
<script src="bower/angular-translate-storage-cookie/angular-translate-storage-cookie.js"></script>
<script src="bower/angular-translate-storage-local/angular-translate-storage-local.js"></script>
<script src="bower/angular-translate/angular-translate.js"></script>
<script src="bower/angular-ui-router/release/angular-ui-router.js"></script>
<script src="bower/angular/angular.js"></script>
<script src="bower/bootswatch-dist/js/bootstrap.js"></script>
<script src="bower/jquery/dist/jquery.js"></script>
<script src="bower/lodash/lodash.js"></script>
<!-- /include -->

bower/angular/angular.js is duplicated

from grunt-include-source.

jwvdiermen avatar jwvdiermen commented on July 21, 2024

I see what you mean, but I'm not sure how this can be solved. Maybe by implementing a secondary pattern to exclude certain files:

<!-- include: "type": "js", "files": "bower/angular/**/*.js" -->
<!-- /include -->

<!-- include: "type": "js", "files": "bower/**/*.js", "exclude": "bower/angular/**/*.js" -->
<!-- /include -->

What do you think? Shouldn't be difficult to implement.

from grunt-include-source.

edgar0011 avatar edgar0011 commented on July 21, 2024

Hi thanks for replying,

I think best would be if files would accept sort for comma delimited list of file patterns, so that exclusion could be achieved by exclamation mark:
"files": "bower///*.js, !bower/angular//*.js"

but what ever is easier, explicit exclude argument is also fine, but would have to accept list of patterns as well...IMHO

Thanks,

Martin

from grunt-include-source.

bryanstrader avatar bryanstrader commented on July 21, 2024

The ability to exclude files would be great, and would help with the ordering issue as well (workaround).

from grunt-include-source.

jwvdiermen avatar jwvdiermen commented on July 21, 2024

This should now work as described in http://gruntjs.com/api/grunt.file#grunt.file.expand. See also https://github.com/jwvdiermen/grunt-include-source/blob/master/test/files/index.html#L69 for an example.

This is native for the pattern, but adding a ! didn't work for me when using a comma separated list. So I manually split the files option before passing it to grunt's expand method.

Closing now, let me know if this doesn't work for you.

from grunt-include-source.

genu avatar genu commented on July 21, 2024

Can you provide a more complete example of working with exclusions?

What do you mean by

So I manually split the files option before passing it to grunt's expand method.

How do you do that?

from grunt-include-source.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.