Documentation of es6 transcompile and packaging
This commit is contained in:
parent
c8adfc5595
commit
ba299b2a4c
18
gulpfile.js
18
gulpfile.js
@ -107,10 +107,26 @@ function browserify_base(entry) {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Transcompile and package common modules to be included in tutti.js.
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* src/scripts/js/es6/common/api/init.js
|
||||||
|
* src/scripts/js/es6/common/events/init.js
|
||||||
|
* Everything exported in api/init.js will end up in module pillar.api.*, and everything exported in events/init.js
|
||||||
|
* will end up in pillar.events.*
|
||||||
|
*/
|
||||||
function browserify_common() {
|
function browserify_common() {
|
||||||
return glob.sync('src/scripts/js/es6/common/**/init.js').map(browserify_base);
|
return glob.sync('src/scripts/js/es6/common/**/init.js').map(browserify_base);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Transcompile and package individual modules.
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* src/scripts/js/es6/individual/coolstuff/init.js
|
||||||
|
* Will create a coolstuff.js and everything exported in init.js will end up in namespace pillar.coolstuff.*
|
||||||
|
*/
|
||||||
gulp.task('scripts_browserify', function(done) {
|
gulp.task('scripts_browserify', function(done) {
|
||||||
glob('src/scripts/js/es6/individual/**/init.js', function(err, files) {
|
glob('src/scripts/js/es6/individual/**/init.js', function(err, files) {
|
||||||
if(err) done(err);
|
if(err) done(err);
|
||||||
@ -128,7 +144,7 @@ gulp.task('scripts_browserify', function(done) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
/* Collection of scripts in src/scripts/tutti/ to merge into tutti.min.js
|
/* Collection of scripts in src/scripts/tutti/ and src/scripts/js/es6/common/ to merge into tutti.min.js
|
||||||
* Since it's always loaded, it's only for functions that we want site-wide.
|
* Since it's always loaded, it's only for functions that we want site-wide.
|
||||||
* It also includes jQuery and Bootstrap (and its dependency popper), since
|
* It also includes jQuery and Bootstrap (and its dependency popper), since
|
||||||
* the site doesn't work without it anyway.*/
|
* the site doesn't work without it anyway.*/
|
||||||
|
2
src/scripts/js/es6/common/README.md
Normal file
2
src/scripts/js/es6/common/README.md
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
Gulp will transpile everything in this folder. Every sub folder containing a init.js file exporting functions/classes
|
||||||
|
will be packed into a module in tutti.js under the namespace pillar.FOLDER_NAME.
|
2
src/scripts/js/es6/individual/README.md
Normal file
2
src/scripts/js/es6/individual/README.md
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
Gulp will transpile everything in this folder. Every sub folder containing a init.js file will become a file named
|
||||||
|
FOLDER_NAME.js containing the exported functions/classes under the namespace pillar.FOLDER_NAME.
|
Loading…
x
Reference in New Issue
Block a user