Skip to content
Snippets Groups Projects
Commit 381fc781 authored by DCoded's avatar DCoded
Browse files
parents e9ae55db a659c342
No related branches found
No related tags found
1 merge request!10384Farmyard changes and polishes
......@@ -99,12 +99,20 @@ function tweeCompileCommand() {
return `${tweeCompilerExecutable()} -f ${cfg.twineformat} --head=${cfg.sources.head} -o ${path.join(cfg.dirs.intermediate, htmlOut)} ${moduleArgs.join(' ')} ${sources.join(' ')}`;
}
/**
* gulp-sort uses String.localeCompare() by default, which may be case-insensitive,
* while we require case -sensitive sorting for sources
*/
function pathcmp(a, b) {
return (a.path < b.path ? -1 : (a.path > b.path ? 1 : 0));
}
/**
* Creates a pipeline that sorts and combines files
*/
function concatFiles(srcGlob, destDir, destFileName) {
return gulp.src(srcGlob)
.pipe(sort())
.pipe(sort(pathcmp))
.pipe(concat(destFileName))
.pipe(gulp.dest(destDir));
}
......@@ -120,7 +128,7 @@ function processScripts(srcGlob, destDir, destFileName) {
const addSourcemaps = !args.release;
const prefix = path.relative(destDir, srcGlob.substr(0, srcGlob.indexOf('*')));
return gulp.src(srcGlob)
.pipe(sort())
.pipe(sort(pathcmp))
.pipe(addSourcemaps ? sourcemaps.init() : noop())
.pipe(concat(destFileName))
.pipe(addSourcemaps ?
......@@ -144,7 +152,7 @@ function processStylesheets(srcGlob, destDir, destFileName) {
const addSourcemaps = !args.release;
const prefix = path.relative(destDir, srcGlob.substr(0, srcGlob.indexOf('*')));
return gulp.src(srcGlob)
.pipe(sort())
.pipe(sort(pathcmp))
.pipe(addSourcemaps ? sourcemaps.init() : noop())
.pipe(concat(destFileName))
.pipe(cfg.options.css.autoprefix ?
......@@ -332,7 +340,7 @@ gulp.task('twineCSS', function() {
gulp.task('twineJS', function() {
return gulp.src([...cfg.sources.module.js, ...cfg.sources.story.js, '!src/art/assistantArt.js'])
.pipe(stripCssJSComments({trim: true}))
.pipe(sort())
.pipe(sort(pathcmp))
.pipe(concat('twine JS.txt'))
.pipe(gulp.dest('devNotes'));
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment