如何在没有链接器的Sails.js v0.12下加载jQuery BEFORE bootstrap.js?

时间:2016-08-03 12:42:55

标签: jquery twitter-bootstrap gruntjs sails.js

如您所知,Sails v0.1X不再需要--linker。在这种情况下,我怎样才能让Gruntfile.js在加载bootstrap.js之前加载jQuery?

1 个答案:

答案 0 :(得分:1)

您可以设置特定订单以在tasks/pipeline.js文件中加载资源:

// Client-side javascript files to inject in order
// (uses Grunt-style wildcard/glob/splat expressions)
var jsFilesToInject = [

  // Load sails.io before everything else
  'js/dependencies/sails.io.js',

  // Load jQuery before Bootstrap and other libraries
  'js/dependencies/jquery.js',
  'js/dependencies/bootstrap.js',

  // Dependencies are brought in here
  'js/dependencies/**/*.js',

  // All of the rest of your client-side js files
  // will be injected here in no particular order.
  'js/**/*.js'
];