Skip to content

Commit c162e46

Browse files
committed
alias import so there's only 1 warning
1 parent 2e811bf commit c162e46

File tree

6 files changed

+15
-16
lines changed

6 files changed

+15
-16
lines changed

dist/index.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2873,17 +2873,16 @@ exports.createBus = createBus;
28732873
class Inspect {
28742874
static vars(obj) {
28752875
return __awaiter(this, void 0, void 0, function* () {
2876-
var _a;
28772876
if (typeof process != 'object')
28782877
return;
28792878
let inspectVarsPath = process.env.INSPECT_VARS;
28802879
if (!inspectVarsPath || !obj)
28812880
return;
28822881
// resolve dynamic path to prevent ng webpack static analysis
2882+
const I = (s) => { var _a; return _a = s, Promise.resolve().then(() => require(_a)); };
28832883
const nodeModule = (m) => 'no' + 'de:' + `${m}`;
2884-
yield (_a = nodeModule('fs'), Promise.resolve().then(() => require(_a))).then((fs) => __awaiter(this, void 0, void 0, function* () {
2885-
var _b;
2886-
yield (_b = nodeModule('path'), Promise.resolve().then(() => require(_b))).then(path => {
2884+
yield I(nodeModule('fs')).then((fs) => __awaiter(this, void 0, void 0, function* () {
2885+
yield I(nodeModule('path')).then(path => {
28872886
let varsPath = inspectVarsPath.replace(/\\/g, '/');
28882887
if (varsPath.indexOf('/') >= 0) {
28892888
let dir = path.dirname(varsPath);

dist/servicestack-client.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/servicestack-client.min.mjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

dist/servicestack-client.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2868,9 +2868,10 @@ export class Inspect {
28682868
if (!inspectVarsPath || !obj)
28692869
return;
28702870
// resolve dynamic path to prevent ng webpack static analysis
2871+
const I = (s) => import(/* @vite-ignore */ s);
28712872
const nodeModule = (m) => 'no' + 'de:' + `${m}`;
2872-
await import(/* @vite-ignore */ nodeModule('fs')).then(async (fs) => {
2873-
await import(/* @vite-ignore */ nodeModule('path')).then(path => {
2873+
await I(nodeModule('fs')).then(async (fs) => {
2874+
await I(nodeModule('path')).then(path => {
28742875
let varsPath = inspectVarsPath.replace(/\\/g, '/');
28752876
if (varsPath.indexOf('/') >= 0) {
28762877
let dir = path.dirname(varsPath);

dist/servicestack-client.umd.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3207,23 +3207,22 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
32073207
}
32083208
Inspect.vars = function (obj) {
32093209
return __awaiter(this, void 0, void 0, function () {
3210-
var inspectVarsPath, nodeModule;
3210+
var inspectVarsPath, I, nodeModule;
32113211
var _this = this;
32123212
return __generator(this, function (_a) {
3213-
var _b;
32143213
switch (_a.label) {
32153214
case 0:
32163215
if (typeof process != 'object')
32173216
return [2 /*return*/];
32183217
inspectVarsPath = process.env.INSPECT_VARS;
32193218
if (!inspectVarsPath || !obj)
32203219
return [2 /*return*/];
3220+
I = function (s) { var _a; return __syncRequire ? (_a = s, Promise.resolve().then(function () { return require(_a); })) : new Promise(function (resolve_1, reject_1) { require([/* @vite-ignore */ s], resolve_1, reject_1); }); };
32213221
nodeModule = function (m) { return 'no' + 'de:' + "".concat(m); };
3222-
return [4 /*yield*/, (_b = nodeModule('fs'), __syncRequire ? Promise.resolve().then(function () { return require(_b); }) : new Promise(function (resolve_1, reject_1) { require([_b], resolve_1, reject_1); })).then(function (fs) { return __awaiter(_this, void 0, void 0, function () {
3222+
return [4 /*yield*/, I(nodeModule('fs')).then(function (fs) { return __awaiter(_this, void 0, void 0, function () {
32233223
return __generator(this, function (_a) {
3224-
var _b;
32253224
switch (_a.label) {
3226-
case 0: return [4 /*yield*/, (_b = nodeModule('path'), __syncRequire ? Promise.resolve().then(function () { return require(_b); }) : new Promise(function (resolve_2, reject_2) { require([_b], resolve_2, reject_2); })).then(function (path) {
3225+
case 0: return [4 /*yield*/, I(nodeModule('path')).then(function (path) {
32273226
var varsPath = inspectVarsPath.replace(/\\/g, '/');
32283227
if (varsPath.indexOf('/') >= 0) {
32293228
var dir = path.dirname(varsPath);

src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3326,10 +3326,10 @@ export class Inspect {
33263326
return
33273327

33283328
// resolve dynamic path to prevent ng webpack static analysis
3329+
const I = (s:string) => import(/* @vite-ignore */ s)
33293330
const nodeModule = (m:string) => 'no' + 'de:' + `${m}`
3330-
3331-
await import(/* @vite-ignore */ nodeModule('fs')).then(async fs => {
3332-
await import(/* @vite-ignore */ nodeModule('path')).then(path => {
3331+
await I(nodeModule('fs')).then(async fs => {
3332+
await I(nodeModule('path')).then(path => {
33333333
let varsPath = inspectVarsPath.replace(/\\/g,'/')
33343334
if (varsPath.indexOf('/') >= 0) {
33353335
let dir = path.dirname(varsPath)

0 commit comments

Comments
 (0)