Concat scripts in order with Gulp

后端 未结 17 1518
后悔当初
后悔当初 2020-11-28 01:51

Say, for example, you are building a project on Backbone or whatever and you need to load scripts in a certain order, e.g. underscore.js needs to be loaded befo

17条回答
  •  囚心锁ツ
    2020-11-28 02:35

    Another thing that helps if you need some files to come after a blob of files, is to exclude specific files from your glob, like so:

    [
      '/src/**/!(foobar)*.js', // all files that end in .js EXCEPT foobar*.js
      '/src/js/foobar.js',
    ]
    

    You can combine this with specifying files that need to come first as explained in Chad Johnson's answer.

提交回复
热议问题