[internal] Keep the .cjs extension when compiling source files (#12820)

* [internal] Keep the .cjs extension when compiling

* yarn
This commit is contained in:
Nicolò Ribaudo
2021-02-25 18:03:05 +01:00
committed by GitHub
parent 74db827c0a
commit b17231e1af
6 changed files with 19 additions and 3 deletions

View File

@@ -11,6 +11,7 @@ import babel from "gulp-babel";
import camelCase from "lodash/camelCase.js";
import fancyLog from "fancy-log";
import filter from "gulp-filter";
import revertPath from "gulp-revert-path";
import gulp from "gulp";
import { rollup } from "rollup";
import { babel as rollupBabel } from "@rollup/plugin-babel";
@@ -229,6 +230,10 @@ function buildBabel(exclude) {
},
})
)
.pipe(
// gulp-babel always converts the extension to .js, but we want to keep the original one
revertPath()
)
.pipe(
// Passing 'file.relative' because newer() above uses a relative
// path and this keeps it consistent.