Fix use of certain built-in node modules in config file (#745)
parent
89dd104419
commit
33f94bae1a
|
@ -20,7 +20,6 @@
|
||||||
"@types/vscode": "1.65.0",
|
"@types/vscode": "1.65.0",
|
||||||
"becke-ch--regex--s0-0-v1--base--pl--lib": "1.4.0",
|
"becke-ch--regex--s0-0-v1--base--pl--lib": "1.4.0",
|
||||||
"braces": "3.0.2",
|
"braces": "3.0.2",
|
||||||
"builtin-modules": "3.2.0",
|
|
||||||
"chokidar": "3.5.1",
|
"chokidar": "3.5.1",
|
||||||
"color-name": "1.1.4",
|
"color-name": "1.1.4",
|
||||||
"concurrently": "7.0.0",
|
"concurrently": "7.0.0",
|
||||||
|
@ -34,6 +33,7 @@
|
||||||
"enhanced-resolve-301": "0.0.1",
|
"enhanced-resolve-301": "0.0.1",
|
||||||
"fast-glob": "3.2.4",
|
"fast-glob": "3.2.4",
|
||||||
"find-up": "5.0.0",
|
"find-up": "5.0.0",
|
||||||
|
"is-builtin-module": "3.2.1",
|
||||||
"jest": "25.5.4",
|
"jest": "25.5.4",
|
||||||
"klona": "2.0.4",
|
"klona": "2.0.4",
|
||||||
"license-checker": "25.0.1",
|
"license-checker": "25.0.1",
|
||||||
|
@ -6069,9 +6069,9 @@
|
||||||
"integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A=="
|
"integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A=="
|
||||||
},
|
},
|
||||||
"node_modules/builtin-modules": {
|
"node_modules/builtin-modules": {
|
||||||
"version": "3.2.0",
|
"version": "3.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz",
|
||||||
"integrity": "sha512-lGzLKcioL90C7wMczpkY0n/oART3MbBa8R9OFGE1rJxoVI86u4WAGfEk8Wjv10eKSyTHVGkSo3bvBylCEtk7LA==",
|
"integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6"
|
"node": ">=6"
|
||||||
},
|
},
|
||||||
|
@ -12093,6 +12093,20 @@
|
||||||
"resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz",
|
"resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz",
|
||||||
"integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w=="
|
"integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w=="
|
||||||
},
|
},
|
||||||
|
"node_modules/is-builtin-module": {
|
||||||
|
"version": "3.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.2.1.tgz",
|
||||||
|
"integrity": "sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==",
|
||||||
|
"dependencies": {
|
||||||
|
"builtin-modules": "^3.3.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/is-callable": {
|
"node_modules/is-callable": {
|
||||||
"version": "1.2.7",
|
"version": "1.2.7",
|
||||||
"resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz",
|
"resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz",
|
||||||
|
@ -26398,9 +26412,9 @@
|
||||||
"integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A=="
|
"integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A=="
|
||||||
},
|
},
|
||||||
"builtin-modules": {
|
"builtin-modules": {
|
||||||
"version": "3.2.0",
|
"version": "3.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz",
|
||||||
"integrity": "sha512-lGzLKcioL90C7wMczpkY0n/oART3MbBa8R9OFGE1rJxoVI86u4WAGfEk8Wjv10eKSyTHVGkSo3bvBylCEtk7LA=="
|
"integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw=="
|
||||||
},
|
},
|
||||||
"builtins": {
|
"builtins": {
|
||||||
"version": "1.0.3",
|
"version": "1.0.3",
|
||||||
|
@ -31057,6 +31071,14 @@
|
||||||
"resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz",
|
"resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz",
|
||||||
"integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w=="
|
"integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w=="
|
||||||
},
|
},
|
||||||
|
"is-builtin-module": {
|
||||||
|
"version": "3.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.2.1.tgz",
|
||||||
|
"integrity": "sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==",
|
||||||
|
"requires": {
|
||||||
|
"builtin-modules": "^3.3.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"is-callable": {
|
"is-callable": {
|
||||||
"version": "1.2.7",
|
"version": "1.2.7",
|
||||||
"resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz",
|
"resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz",
|
||||||
|
|
|
@ -40,7 +40,6 @@
|
||||||
"@types/debounce": "1.2.0",
|
"@types/debounce": "1.2.0",
|
||||||
"@types/node": "14.14.34",
|
"@types/node": "14.14.34",
|
||||||
"@types/vscode": "1.65.0",
|
"@types/vscode": "1.65.0",
|
||||||
"builtin-modules": "3.2.0",
|
|
||||||
"chokidar": "3.5.1",
|
"chokidar": "3.5.1",
|
||||||
"color-name": "1.1.4",
|
"color-name": "1.1.4",
|
||||||
"culori": "0.20.1",
|
"culori": "0.20.1",
|
||||||
|
@ -51,6 +50,7 @@
|
||||||
"enhanced-resolve-301": "0.0.1",
|
"enhanced-resolve-301": "0.0.1",
|
||||||
"fast-glob": "3.2.4",
|
"fast-glob": "3.2.4",
|
||||||
"find-up": "5.0.0",
|
"find-up": "5.0.0",
|
||||||
|
"is-builtin-module": "3.2.1",
|
||||||
"jest": "25.5.4",
|
"jest": "25.5.4",
|
||||||
"klona": "2.0.4",
|
"klona": "2.0.4",
|
||||||
"license-checker": "25.0.1",
|
"license-checker": "25.0.1",
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import Module from 'module'
|
import Module from 'module'
|
||||||
import * as path from 'path'
|
import * as path from 'path'
|
||||||
import resolveFrom from '../util/resolveFrom'
|
import resolveFrom from '../util/resolveFrom'
|
||||||
import builtInModules from 'builtin-modules'
|
import isBuiltinModule from 'is-builtin-module'
|
||||||
|
|
||||||
process.env.TAILWIND_MODE = 'build'
|
process.env.TAILWIND_MODE = 'build'
|
||||||
process.env.TAILWIND_DISABLE_TOUCH = 'true'
|
process.env.TAILWIND_DISABLE_TOUCH = 'true'
|
||||||
|
@ -9,10 +9,7 @@ process.env.TAILWIND_DISABLE_TOUCH = 'true'
|
||||||
let oldResolveFilename = (Module as any)._resolveFilename
|
let oldResolveFilename = (Module as any)._resolveFilename
|
||||||
|
|
||||||
;(Module as any)._resolveFilename = (id: any, parent: any) => {
|
;(Module as any)._resolveFilename = (id: any, parent: any) => {
|
||||||
if (
|
if (typeof id === 'string' && isBuiltinModule(id)) {
|
||||||
typeof id === 'string' &&
|
|
||||||
(builtInModules.includes(id) || builtInModules.includes(id.replace(/^node:/, '')))
|
|
||||||
) {
|
|
||||||
return oldResolveFilename(id, parent)
|
return oldResolveFilename(id, parent)
|
||||||
}
|
}
|
||||||
return resolveFrom(path.dirname(parent.id), id)
|
return resolveFrom(path.dirname(parent.id), id)
|
||||||
|
|
Loading…
Reference in New Issue