Skip to content

Commit 982ac22

Browse files
committed
Only rename the file if it's a JavaScript file
This prevents the build process from choking on .map files. Now we don't need gulp-replace
1 parent c8c6bee commit 982ac22

3 files changed

Lines changed: 3 additions & 101 deletions

File tree

gulpfile.mjs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import { createGulpEsbuild } from 'gulp-esbuild';
2323
var esbuild = createGulpEsbuild({
2424
pipe: true,
2525
});
26-
import replace from 'gulp-replace'; // Search and replace contents
2726

2827
// Utility related plugins.
2928
import fs from 'fs'; // The filesystem for manipulating files
@@ -177,15 +176,12 @@ gulp.task('scripts', function () {
177176
.pipe(lineec()) // Consistent Line Endings for non UNIX systems
178177
.pipe(
179178
rename(function (path) {
180-
path.basename = path.basename.replace('.src', '');
179+
if (path.extname === '.js') {
180+
path.basename = path.basename.replace('.src', '');
181+
}
181182
return path;
182183
})
183184
)
184-
.pipe(
185-
replace(/\/\/# sourceMappingURL=.*$/m, function () {
186-
return `//# sourceMappingURL=${this.file.basename}.map`;
187-
})
188-
)
189185
.pipe(gulp.dest(config.scriptDest))
190186
.on('finish', () => {
191187
if (!hadError) {

package-lock.json

Lines changed: 0 additions & 93 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
"gulp-postcss": "^10.0.0",
3838
"gulp-prettier": "^6.0.0",
3939
"gulp-rename": "^2.0.0",
40-
"gulp-replace": "^1.1.4",
4140
"gulp-sass": "^6.0.0",
4241
"gulp-sourcemaps": "^3.0.0",
4342
"intersection-observer-debugger": "^0.1.1",

0 commit comments

Comments
 (0)