@gravity-ui/app-builder 0.29.3-beta.0 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +138 -0
- package/dist/cli.js +17 -22
- package/dist/commands/build/build-lib.js +5 -8
- package/dist/commands/build/build-service/client.js +3 -6
- package/dist/commands/build/build-service/index.js +4 -7
- package/dist/commands/build/build-service/server.js +11 -17
- package/dist/commands/build/index.js +3 -6
- package/dist/commands/dev/client.js +34 -63
- package/dist/commands/dev/index.js +26 -47
- package/dist/commands/dev/server.js +13 -42
- package/dist/common/babel/index.js +1 -4
- package/dist/common/babel/ui-preset.d.ts +1 -1
- package/dist/common/babel/ui-preset.js +0 -1
- package/dist/common/child-process/controllable-script.js +5 -32
- package/dist/common/child-process/utils.js +4 -30
- package/dist/common/command.js +1 -2
- package/dist/common/config.js +36 -45
- package/dist/common/env.js +3 -5
- package/dist/common/library/babel-plugin-replace-paths.js +2 -4
- package/dist/common/library/index.js +66 -95
- package/dist/common/logger/colors.js +2 -8
- package/dist/common/logger/index.js +17 -24
- package/dist/common/logger/log-config.js +3 -6
- package/dist/common/logger/pretty-time.js +2 -6
- package/dist/common/models/index.d.ts +66 -1
- package/dist/common/models/index.js +3 -8
- package/dist/common/paths.js +3 -28
- package/dist/common/s3-upload/compress.js +8 -12
- package/dist/common/s3-upload/create-plugin.js +9 -7
- package/dist/common/s3-upload/index.js +3 -9
- package/dist/common/s3-upload/s3-client.js +11 -37
- package/dist/common/s3-upload/upload.js +9 -38
- package/dist/common/s3-upload/webpack-plugin.js +5 -9
- package/dist/common/swc/compile.js +9 -12
- package/dist/common/swc/index.js +2 -7
- package/dist/common/swc/utils.js +6 -13
- package/dist/common/swc/watch.js +6 -9
- package/dist/common/typescript/compile.js +11 -14
- package/dist/common/typescript/diagnostic.js +11 -37
- package/dist/common/typescript/transformers.js +3 -29
- package/dist/common/typescript/utils.js +8 -18
- package/dist/common/typescript/watch.js +10 -13
- package/dist/common/utils.d.ts +3 -1
- package/dist/common/utils.js +16 -22
- package/dist/common/webpack/compile.js +16 -22
- package/dist/common/webpack/config.d.ts +0 -2
- package/dist/common/webpack/config.js +187 -137
- package/dist/common/webpack/node-externals.js +5 -34
- package/dist/common/webpack/progress-plugin.js +3 -6
- package/dist/common/webpack/public-path.d.ts +0 -1
- package/dist/common/webpack/public-path.js +1 -1
- package/dist/common/webpack/rspack.js +1 -5
- package/dist/common/webpack/runtime-versioning-plugin.d.ts +5 -0
- package/dist/common/webpack/runtime-versioning-plugin.js +20 -0
- package/dist/common/webpack/storybook.js +21 -53
- package/dist/common/webpack/utils.js +9 -36
- package/dist/common/webpack/worker/public-path.worker.d.ts +0 -1
- package/dist/common/webpack/worker/public-path.worker.js +2 -1
- package/dist/common/webpack/worker/worker-loader.js +4 -34
- package/dist/create-cli.d.ts +2 -2
- package/dist/create-cli.js +19 -48
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -27
- package/package.json +9 -6
|
@@ -1,37 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.watchServerCompilation = watchServerCompilation;
|
|
30
|
-
const path = __importStar(require("node:path"));
|
|
31
|
-
const rimraf_1 = require("rimraf");
|
|
32
|
-
const controllable_script_1 = require("../../common/child-process/controllable-script");
|
|
33
|
-
const utils_1 = require("../../common/utils");
|
|
34
|
-
const paths_1 = __importDefault(require("../../common/paths"));
|
|
1
|
+
import * as path from 'node:path';
|
|
2
|
+
import { rimraf } from 'rimraf';
|
|
3
|
+
import { ControllableScript } from '../../common/child-process/controllable-script';
|
|
4
|
+
import { createRunFolder } from '../../common/utils';
|
|
5
|
+
import paths from '../../common/paths';
|
|
35
6
|
function createTypescriptBuildScript(config) {
|
|
36
7
|
return `
|
|
37
8
|
let ts;
|
|
@@ -49,7 +20,7 @@ const {watch} = require(${JSON.stringify(require.resolve('../../common/typescrip
|
|
|
49
20
|
const logger = new Logger('server', ${config.verbose});
|
|
50
21
|
watch(
|
|
51
22
|
ts,
|
|
52
|
-
${JSON.stringify(
|
|
23
|
+
${JSON.stringify(paths.appServer)},
|
|
53
24
|
{
|
|
54
25
|
logger,
|
|
55
26
|
onAfterFilesEmitted: () => {
|
|
@@ -66,9 +37,9 @@ const {watch} = require(${JSON.stringify(require.resolve('../../common/swc/watch
|
|
|
66
37
|
|
|
67
38
|
const logger = new Logger('server', ${config.verbose});
|
|
68
39
|
watch(
|
|
69
|
-
${JSON.stringify(
|
|
40
|
+
${JSON.stringify(paths.appServer)},
|
|
70
41
|
{
|
|
71
|
-
outputPath: ${JSON.stringify(
|
|
42
|
+
outputPath: ${JSON.stringify(paths.appDist)},
|
|
72
43
|
logger,
|
|
73
44
|
onAfterFilesEmitted: () => {
|
|
74
45
|
process.send({type: 'Emitted'});
|
|
@@ -76,11 +47,11 @@ watch(
|
|
|
76
47
|
}
|
|
77
48
|
);`;
|
|
78
49
|
}
|
|
79
|
-
async function watchServerCompilation(config) {
|
|
80
|
-
const serverPath = path.resolve(
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
const build = new
|
|
50
|
+
export async function watchServerCompilation(config) {
|
|
51
|
+
const serverPath = path.resolve(paths.appDist, 'server');
|
|
52
|
+
rimraf.sync(serverPath);
|
|
53
|
+
createRunFolder(config);
|
|
54
|
+
const build = new ControllableScript(config.server.compiler === 'swc'
|
|
84
55
|
? createSWCBuildScript(config)
|
|
85
56
|
: createTypescriptBuildScript(config), null);
|
|
86
57
|
await build.start();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
declare function getOption<T>(value: T, defaultValue: T): T;
|
|
@@ -1,33 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.ControllableScript = void 0;
|
|
27
|
-
const utils_1 = require("./utils");
|
|
28
|
-
const fs = __importStar(require("fs-extra"));
|
|
29
|
-
const utils_2 = require("../utils");
|
|
30
|
-
class ControllableScript {
|
|
1
|
+
import { tmpNameSync } from './utils';
|
|
2
|
+
import * as fs from 'fs-extra';
|
|
3
|
+
import { getCacheDir } from '../utils';
|
|
4
|
+
export class ControllableScript {
|
|
31
5
|
isRunning = false;
|
|
32
6
|
process;
|
|
33
7
|
script = '';
|
|
@@ -38,7 +12,7 @@ class ControllableScript {
|
|
|
38
12
|
}
|
|
39
13
|
async start() {
|
|
40
14
|
const args = [];
|
|
41
|
-
const tmpFileName =
|
|
15
|
+
const tmpFileName = tmpNameSync(await getCacheDir());
|
|
42
16
|
fs.outputFileSync(tmpFileName, this.script);
|
|
43
17
|
this.isRunning = true;
|
|
44
18
|
// Passing --inspect isn't necessary for the child process to launch a port, but it allows some editors to automatically attach
|
|
@@ -123,4 +97,3 @@ class ControllableScript {
|
|
|
123
97
|
this.process.send(msg);
|
|
124
98
|
}
|
|
125
99
|
}
|
|
126
|
-
exports.ControllableScript = ControllableScript;
|
|
@@ -1,32 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.tmpNameSync = tmpNameSync;
|
|
27
|
-
const crypto = __importStar(require("node:crypto"));
|
|
28
|
-
const path = __importStar(require("node:path"));
|
|
29
|
-
const fs = __importStar(require("fs-extra"));
|
|
1
|
+
import * as crypto from 'node:crypto';
|
|
2
|
+
import * as path from 'node:path';
|
|
3
|
+
import * as fs from 'fs-extra';
|
|
30
4
|
const RANDOM_CHARS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
|
31
5
|
function randomChars(howMany) {
|
|
32
6
|
const value = [];
|
|
@@ -48,7 +22,7 @@ function generateTmpName(tmpDir) {
|
|
|
48
22
|
const name = ['tmp', '-', process.pid, '-', randomChars(12)].join('');
|
|
49
23
|
return path.join(tmpDir, name);
|
|
50
24
|
}
|
|
51
|
-
function tmpNameSync(tmpDir, retries = 3) {
|
|
25
|
+
export function tmpNameSync(tmpDir, retries = 3) {
|
|
52
26
|
let tries = retries;
|
|
53
27
|
do {
|
|
54
28
|
const name = generateTmpName(tmpDir);
|
package/dist/common/command.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/dist/common/config.js
CHANGED
|
@@ -1,35 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.getProjectConfig = getProjectConfig;
|
|
27
|
-
exports.normalizeConfig = normalizeConfig;
|
|
28
|
-
const path = __importStar(require("node:path"));
|
|
29
|
-
const cosmiconfig_1 = require("cosmiconfig");
|
|
30
|
-
const cosmiconfig_typescript_loader_1 = require("cosmiconfig-typescript-loader");
|
|
31
|
-
const models_1 = require("./models");
|
|
32
|
-
const utils_1 = require("./utils");
|
|
1
|
+
import * as path from 'node:path';
|
|
2
|
+
import { cosmiconfigSync } from 'cosmiconfig';
|
|
3
|
+
import { TypeScriptLoader as getTsLoader } from 'cosmiconfig-typescript-loader';
|
|
4
|
+
import { stripIndent } from 'common-tags';
|
|
5
|
+
import { isLibraryConfig, isServiceConfig } from './models';
|
|
6
|
+
import { getPort } from './utils';
|
|
7
|
+
import logger from './logger';
|
|
33
8
|
function splitPaths(paths) {
|
|
34
9
|
return (Array.isArray(paths) ? paths : [paths]).flatMap((p) => p.split(','));
|
|
35
10
|
}
|
|
@@ -47,7 +22,7 @@ function omitUndefined(obj) {
|
|
|
47
22
|
}
|
|
48
23
|
function getModuleLoader({ storybook } = {}) {
|
|
49
24
|
if (!storybook) {
|
|
50
|
-
return (
|
|
25
|
+
return getTsLoader();
|
|
51
26
|
}
|
|
52
27
|
// storybook 7 uses esbuild-register to compile ts to cjs
|
|
53
28
|
// https://github.com/storybookjs/storybook/blob/c1ec290b3a74ce05b23f74250539ae571bffaa66/code/lib/core-common/src/utils/interpret-require.ts#L11
|
|
@@ -61,10 +36,10 @@ function getModuleLoader({ storybook } = {}) {
|
|
|
61
36
|
};
|
|
62
37
|
}
|
|
63
38
|
else {
|
|
64
|
-
return (
|
|
39
|
+
return getTsLoader();
|
|
65
40
|
}
|
|
66
41
|
}
|
|
67
|
-
async function getProjectConfig(command, { env, storybook, ...argv }) {
|
|
42
|
+
export async function getProjectConfig(command, { env, storybook, ...argv }) {
|
|
68
43
|
function getLoader(loader) {
|
|
69
44
|
return async (pathname, content) => {
|
|
70
45
|
const config = loader(pathname, content);
|
|
@@ -76,7 +51,7 @@ async function getProjectConfig(command, { env, storybook, ...argv }) {
|
|
|
76
51
|
}
|
|
77
52
|
const tsLoader = getLoader(getModuleLoader({ storybook }));
|
|
78
53
|
const moduleName = 'app-builder';
|
|
79
|
-
const explorer =
|
|
54
|
+
const explorer = cosmiconfigSync(moduleName, {
|
|
80
55
|
cache: false,
|
|
81
56
|
stopDir: process.cwd(),
|
|
82
57
|
searchPlaces: [
|
|
@@ -106,7 +81,7 @@ async function getProjectConfig(command, { env, storybook, ...argv }) {
|
|
|
106
81
|
cfg = explorer.search();
|
|
107
82
|
}
|
|
108
83
|
const config = { verbose: false, ...(await cfg?.config) };
|
|
109
|
-
if (
|
|
84
|
+
if (isLibraryConfig(config)) {
|
|
110
85
|
return normalizeConfig({
|
|
111
86
|
...config,
|
|
112
87
|
...omitUndefined({ verbose: argv.verbose }),
|
|
@@ -141,8 +116,8 @@ async function getProjectConfig(command, { env, storybook, ...argv }) {
|
|
|
141
116
|
};
|
|
142
117
|
return normalizeConfig(projectConfig, command);
|
|
143
118
|
}
|
|
144
|
-
async function normalizeConfig(userConfig, mode) {
|
|
145
|
-
if (
|
|
119
|
+
export async function normalizeConfig(userConfig, mode) {
|
|
120
|
+
if (isServiceConfig(userConfig)) {
|
|
146
121
|
const clientConfig = typeof userConfig.client === 'object' ? userConfig.client : {};
|
|
147
122
|
const client = await normalizeClientConfig(clientConfig, mode);
|
|
148
123
|
client.verbose = userConfig.verbose;
|
|
@@ -158,7 +133,7 @@ async function normalizeConfig(userConfig, mode) {
|
|
|
158
133
|
};
|
|
159
134
|
if (mode === 'dev') {
|
|
160
135
|
if (serverConfig.port === true) {
|
|
161
|
-
server.port = await
|
|
136
|
+
server.port = await getPort({ port: 3000 });
|
|
162
137
|
}
|
|
163
138
|
else {
|
|
164
139
|
server.port = serverConfig.port;
|
|
@@ -183,6 +158,18 @@ async function normalizeConfig(userConfig, mode) {
|
|
|
183
158
|
return config;
|
|
184
159
|
}
|
|
185
160
|
async function normalizeClientConfig(client, mode) {
|
|
161
|
+
let publicPath = client.publicPath || path.normalize(`${client.publicPathPrefix || ''}/build/`);
|
|
162
|
+
if (client.moduleFederation) {
|
|
163
|
+
publicPath = path.normalize(`${publicPath}${client.moduleFederation.name}/`);
|
|
164
|
+
}
|
|
165
|
+
let transformCssWithLightningCss = Boolean(client.transformCssWithLightningCss);
|
|
166
|
+
if (client.moduleFederation?.isolateStyles && transformCssWithLightningCss) {
|
|
167
|
+
transformCssWithLightningCss = false;
|
|
168
|
+
logger.warning(stripIndent `
|
|
169
|
+
transformCssWithLightningCss option is disabled because moduleFederation.isolateStyles is enabled.
|
|
170
|
+
postcss loader will be used instead.
|
|
171
|
+
`);
|
|
172
|
+
}
|
|
186
173
|
const normalizedConfig = {
|
|
187
174
|
...client,
|
|
188
175
|
forkTsChecker: client.disableForkTsChecker ? false : client.forkTsChecker,
|
|
@@ -190,14 +177,18 @@ async function normalizeClientConfig(client, mode) {
|
|
|
190
177
|
? false
|
|
191
178
|
: (client.reactRefresh ?? ((options) => options)),
|
|
192
179
|
newJsxTransform: client.newJsxTransform ?? true,
|
|
193
|
-
publicPath
|
|
194
|
-
assetsManifestFile: client.assetsManifestFile ||
|
|
180
|
+
publicPath,
|
|
181
|
+
assetsManifestFile: client.assetsManifestFile ||
|
|
182
|
+
(client.moduleFederation?.version
|
|
183
|
+
? `assets-manifest-${client.moduleFederation.version}.json`
|
|
184
|
+
: 'assets-manifest.json'),
|
|
195
185
|
modules: client.modules && remapPaths(client.modules),
|
|
196
186
|
includes: client.includes && remapPaths(client.includes),
|
|
197
187
|
images: client.images && remapPaths(client.images),
|
|
198
188
|
hiddenSourceMap: client.hiddenSourceMap ?? true,
|
|
199
189
|
svgr: client.svgr ?? {},
|
|
200
190
|
entryFilter: client.entryFilter && splitPaths(client.entryFilter),
|
|
191
|
+
transformCssWithLightningCss,
|
|
201
192
|
webpack: typeof client.webpack === 'function' ? client.webpack : (config) => config,
|
|
202
193
|
rspack: typeof client.rspack === 'function' ? client.rspack : (config) => config,
|
|
203
194
|
babel: typeof client.babel === 'function' ? client.babel : (config) => config,
|
|
@@ -211,20 +202,20 @@ async function normalizeClientConfig(client, mode) {
|
|
|
211
202
|
if (client.lazyCompilation) {
|
|
212
203
|
if (client.lazyCompilation === true) {
|
|
213
204
|
normalizedConfig.lazyCompilation = {
|
|
214
|
-
port: await
|
|
205
|
+
port: await getPort({ port: 6000 }),
|
|
215
206
|
};
|
|
216
207
|
}
|
|
217
208
|
else {
|
|
218
209
|
normalizedConfig.lazyCompilation = client.lazyCompilation;
|
|
219
210
|
}
|
|
220
211
|
if (!normalizedConfig.lazyCompilation.port) {
|
|
221
|
-
normalizedConfig.lazyCompilation.port = await
|
|
212
|
+
normalizedConfig.lazyCompilation.port = await getPort({ port: 6000 });
|
|
222
213
|
}
|
|
223
214
|
}
|
|
224
215
|
const devServer = client.devServer?.port
|
|
225
216
|
? {
|
|
226
217
|
port: client.devServer.port === true
|
|
227
|
-
? await
|
|
218
|
+
? await getPort({ port: 8000 })
|
|
228
219
|
: client.devServer.port,
|
|
229
220
|
ipc: undefined,
|
|
230
221
|
}
|
package/dist/common/env.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const dotenv_1 = require("dotenv");
|
|
5
|
-
(0, dotenv_1.config)({ path: (0, node_path_1.resolve)(process.cwd(), '.env') });
|
|
1
|
+
import { resolve } from 'node:path';
|
|
2
|
+
import { config } from 'dotenv';
|
|
3
|
+
config({ path: resolve(process.cwd(), '.env') });
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
1
|
/* eslint-disable no-param-reassign */
|
|
4
|
-
|
|
2
|
+
import { declare } from '@babel/helper-plugin-utils';
|
|
5
3
|
const svgPathRe = /^\.\.\/(.*)\/assets\/(.*)\.svg$/;
|
|
6
|
-
|
|
4
|
+
export default declare(function (api) {
|
|
7
5
|
return {
|
|
8
6
|
visitor: {
|
|
9
7
|
ImportDeclaration(path) {
|