[internal] Keep the .cjs extension when compiling source files (#12820)
* [internal] Keep the .cjs extension when compiling * yarn
This commit is contained in:
parent
74db827c0a
commit
b17231e1af
@ -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.
|
||||
|
||||
@ -56,6 +56,7 @@
|
||||
"gulp-filter": "^5.1.0",
|
||||
"gulp-newer": "^1.0.0",
|
||||
"gulp-plumber": "^1.2.1",
|
||||
"gulp-revert-path": "^2.0.0",
|
||||
"husky": "^3.0.0",
|
||||
"jest": "^26.6.1",
|
||||
"lint-staged": "^9.2.0",
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
import path from "path";
|
||||
|
||||
// $FlowIgnore
|
||||
import escapeRegExp from "./helpers/escape-regexp";
|
||||
import escapeRegExp from "./helpers/escape-regexp.cjs";
|
||||
|
||||
const sep = `\\${path.sep}`;
|
||||
const endSep = `(?:${sep}|$)`;
|
||||
|
||||
@ -15,7 +15,7 @@ import path from "path";
|
||||
import vm from "vm";
|
||||
import checkDuplicatedNodes from "babel-check-duplicated-nodes";
|
||||
import QuickLRU from "quick-lru";
|
||||
import escapeRegExp from "./escape-regexp";
|
||||
import escapeRegExp from "./escape-regexp.cjs";
|
||||
|
||||
const cachedScripts = new QuickLRU({ maxSize: 10 });
|
||||
const contextModuleCache = new WeakMap();
|
||||
|
||||
@ -7,7 +7,7 @@ import { addHook } from "pirates";
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
import Module from "module";
|
||||
import escapeRegExp from "./escape-regexp";
|
||||
import escapeRegExp from "./escape-regexp.cjs";
|
||||
|
||||
const maps = {};
|
||||
let transformOpts = {};
|
||||
|
||||
10
yarn.lock
10
yarn.lock
@ -5466,6 +5466,7 @@ __metadata:
|
||||
gulp-filter: ^5.1.0
|
||||
gulp-newer: ^1.0.0
|
||||
gulp-plumber: ^1.2.1
|
||||
gulp-revert-path: ^2.0.0
|
||||
husky: ^3.0.0
|
||||
jest: ^26.6.1
|
||||
lint-staged: ^9.2.0
|
||||
@ -8735,6 +8736,15 @@ fsevents@^1.2.7:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"gulp-revert-path@npm:^2.0.0":
|
||||
version: 2.0.0
|
||||
resolution: "gulp-revert-path@npm:2.0.0"
|
||||
dependencies:
|
||||
through2: ^2.0.0
|
||||
checksum: c2b01db2942c084f8cb11cecff22663a3ab894cdf43daed601bdaa9c713797e11739415b46f18342171fb0c65c1fe57d18dd40f93da403002e99f453b5661d77
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"gulp@npm:^4.0.2":
|
||||
version: 4.0.2
|
||||
resolution: "gulp@npm:4.0.2"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user