Gathering detailed insights and metrics for grunt-requiregen
Gathering detailed insights and metrics for grunt-requiregen
Gathering detailed insights and metrics for grunt-requiregen
Gathering detailed insights and metrics for grunt-requiregen
npm install grunt-requiregen
Typescript
Module System
Min. Node Version
NPM Version
CoffeeScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
4 Stars
4 Commits
1 Forks
2 Watchers
1 Branches
2 Contributors
Updated on May 02, 2014
Latest Version
0.1.0
Package Id
grunt-requiregen@0.1.0
Size
2.97 kB
NPM Version
1.2.2
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
A grunt plugin which generates a requirejs main.js file, which ensures js files are loaded in the right order
Require.js is a nice tool which combines plugin loading capabilities, and main application minification for prod. Maintaining dependancies between all your modules is a bit cumbersome, especially if you are using angular.js and its dependancy injection system. This would require declaring your dependancies twice.
Angularjs still does not resolves everything as it needs to be loaded first, and usually, you need a bootstrap code to be loaded last. There might be other needs, like jquery very first, app module before its services, etc.
1$ npm install grunt-requiregen
Include the following line in your Grunt file. (Here this is coffeescript version)
1 grunt.loadNpmTasks('grunt-requiregen')
1 # task that generates main.js (the require.js main file) 2 # Angular is actually very nice with its dependancy injection system 3 # basically, we just need angular is loaded first, app second and run last 4 # we should not be modifying this config when the app is growing 5 requiregen: 6 main: 7 cwd: './.temp/scripts/' 8 # require json2 and html5shiv are loaded conditionally in the html file 9 src: ['**/*.js','!libs/require.js', '!libs/json2.js', '!libs/html5shiv-printshiv.js'] 10 options: 11 order: [ 12 # order is a list of minimatch 'glob' like matching 13 # modules, requiregen will generate the correct shim 14 # to load modules in this order 15 # if a module has been loaded in previous layers, it wont be loaded again 16 # so that you can use a more generic minimatch expression in the end 17 'libs/jquery' 18 'libs/angular' # angular needs jquery before or will use internal jqlite 19 'libs/*' # remaining libs before app 20 'app' # app needs libs 21 '{routes,views,config,*/**}' # remaining angularjs components 22 'run' # run has to be in the end, because it is triggering angular's own DI 23 ] 24 dest: '.temp/scripts/main.js'
Have a bug? Please create an issue here on GitHub!
https://github.com/tardyp/grunt-requiregen/issues
Pierre Tardy
Copyright 2013 Pierre Tardy
Licensed under the MIT license.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 1/3 approved changesets -- score normalized to 3
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More