gant-core 2.0.2 → 2.0.4
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/CHANGELOG.md +12 -0
- package/bin/index.js +21 -1
- package/bin/styletext-loader.mjs +30 -0
- package/lib/cli/config/index.js +155 -2
- package/lib/cli/config/index.mjs +3 -0
- package/lib/cli/copyfiles/index.js +33 -2
- package/lib/cli/copyfiles/index.mjs +3 -0
- package/lib/cli/create/config/index.js +1226 -4
- package/lib/cli/create/config/index.mjs +11 -0
- package/lib/cli/create/index.js +4 -2
- package/lib/cli/create/index.mjs +3 -0
- package/lib/cli/create/module/index.js +33214 -2
- package/lib/cli/create/module/index.mjs +3 -0
- package/lib/cli/i18n/index.js +22179 -3
- package/lib/cli/i18n/index.mjs +10 -0
- package/lib/cli/i18n/utils.js +180 -2
- package/lib/cli/i18n/utils.mjs +3 -0
- package/lib/cli/index.js +3655 -2
- package/lib/cli/index.mjs +3 -0
- package/lib/cli/routes/index.js +75 -2
- package/lib/cli/routes/index.mjs +3 -0
- package/lib/cli/tsconfig/index.js +70 -2
- package/lib/cli/tsconfig/index.mjs +3 -0
- package/lib/cli/utils/detectPort.js +120 -2
- package/lib/cli/utils/detectPort.mjs +3 -0
- package/lib/cli/utils/getJavascriptfile.js +14 -2
- package/lib/cli/utils/getJavascriptfile.mjs +3 -0
- package/lib/cli/utils/index.js +4948 -2
- package/lib/cli/utils/index.mjs +3 -0
- package/lib/cli/webpack/Webpack.js +60 -2
- package/lib/cli/webpack/Webpack.mjs +3 -0
- package/lib/cli/webpack/config/analyzer.config.js +17 -2
- package/lib/cli/webpack/config/analyzer.config.mjs +3 -0
- package/lib/cli/webpack/config/browsers.js +13 -2
- package/lib/cli/webpack/config/browsers.mjs +3 -0
- package/lib/cli/webpack/config/cssRules.js +80 -2
- package/lib/cli/webpack/config/cssRules.mjs +3 -0
- package/lib/cli/webpack/config/default.config.js +179 -2
- package/lib/cli/webpack/config/default.config.mjs +3 -0
- package/lib/cli/webpack/config/development.config.js +45 -2
- package/lib/cli/webpack/config/development.config.mjs +3 -0
- package/lib/cli/webpack/config/framework/index.js +25 -2
- package/lib/cli/webpack/config/framework/index.mjs +3 -0
- package/lib/cli/webpack/config/framework/react.js +23 -2
- package/lib/cli/webpack/config/framework/react.mjs +3 -0
- package/lib/cli/webpack/config/framework/vue.js +33 -2
- package/lib/cli/webpack/config/framework/vue.mjs +3 -0
- package/lib/cli/webpack/config/index.js +23 -2
- package/lib/cli/webpack/config/index.mjs +3 -0
- package/lib/cli/webpack/config/production.config.js +74 -2
- package/lib/cli/webpack/config/production.config.mjs +3 -0
- package/lib/cli/webpack/plugins/copy.js +20 -2
- package/lib/cli/webpack/plugins/copy.mjs +3 -0
- package/lib/cli/webpack/plugins/index.js +4 -2
- package/lib/cli/webpack/plugins/index.mjs +3 -0
- package/package.json +2 -2
- package/rollup.config.js +5 -4
- package/.changeset/README.md +0 -8
- package/.changeset/config.json +0 -11
- package/lib/cli/acorn.js +0 -3
- package/lib/cli/angular.js +0 -3
- package/lib/cli/babel.js +0 -3
- package/lib/cli/estree.js +0 -3
- package/lib/cli/flow.js +0 -3
- package/lib/cli/glimmer.js +0 -3
- package/lib/cli/graphql.js +0 -3
- package/lib/cli/html.js +0 -3
- package/lib/cli/markdown.js +0 -3
- package/lib/cli/meriyah.js +0 -3
- package/lib/cli/msmain.js +0 -65
- package/lib/cli/postcss.js +0 -3
- package/lib/cli/typescript.js +0 -3
- package/lib/cli/yaml.js +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# gant-core
|
|
2
2
|
|
|
3
|
+
## 2.0.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 修复 Node.js < 21.7.0 下 @rspack/dev-server 报 `styleText is not a function` 的问题。通过自定义 ESM loader hook 在加载时改写模块源码,为 `util.styleText` 提供 fallback polyfill。
|
|
8
|
+
|
|
9
|
+
## 2.0.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 修复 CLI CJS 格式 require() ESM-only 模块导致的 ERR_REQUIRE_ESM 错误,CLI 输出改为 ESM (.mjs)
|
|
14
|
+
|
|
3
15
|
## 2.0.2
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/bin/index.js
CHANGED
|
@@ -1,9 +1,29 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
const path = require('path');
|
|
2
3
|
const { performance } = require('perf_hooks');
|
|
3
4
|
|
|
4
5
|
global.__gant_start_time = performance.now();
|
|
5
6
|
|
|
7
|
+
// On Node.js < 21.7.0, util.styleText is unavailable but @rspack/dev-server uses it
|
|
8
|
+
// via ESM namespace import (import * as ns from "node:util"). Monkey-patching
|
|
9
|
+
// require("node:util") does NOT propagate to ESM namespace objects on Node 20.
|
|
10
|
+
// We launch a subprocess with a custom ESM --loader that intercepts module loading
|
|
11
|
+
// and rewrites the styleText destructuring to include a fallback polyfill.
|
|
12
|
+
// __GANT_STYLETEXT_POLYFILL env var prevents infinite re-spawn (the loader fixes
|
|
13
|
+
// the issue at source level, so util.styleText remains undefined in the child).
|
|
14
|
+
const util = require('node:util');
|
|
15
|
+
if (!util.styleText && !process.env.__GANT_STYLETEXT_POLYFILL) {
|
|
16
|
+
const { spawnSync } = require('child_process');
|
|
17
|
+
const loaderPath = path.join(__dirname, 'styletext-loader.mjs');
|
|
18
|
+
const args = ['--loader', loaderPath, ...process.argv.slice(1)];
|
|
19
|
+
const result = spawnSync(process.execPath, args, {
|
|
20
|
+
stdio: 'inherit',
|
|
21
|
+
env: { ...process.env, __GANT_STYLETEXT_POLYFILL: '1' },
|
|
22
|
+
});
|
|
23
|
+
process.exit(result.status ?? 1);
|
|
24
|
+
}
|
|
25
|
+
|
|
6
26
|
function start() {
|
|
7
|
-
return import('../lib/cli/index.
|
|
27
|
+
return import('../lib/cli/index.mjs');
|
|
8
28
|
}
|
|
9
29
|
start();
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// ESM loader hook to polyfill util.styleText for Node.js < 21.7.0.
|
|
2
|
+
// @rspack/dev-server uses util.styleText, which is only available since Node.js 21.7.0.
|
|
3
|
+
// This loader intercepts module loading and rewrites the destructuring of styleText
|
|
4
|
+
// from the node:util namespace to use a fallback polyfill when styleText is unavailable.
|
|
5
|
+
|
|
6
|
+
const STYLE_POLYFILL_FN = `(function(f,t){var c={black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]};if(!Array.isArray(f))f=[f];var o=[];for(var i=0;i<f.length;i++){if(c[f[i]])o.push(c[f[i]][0])}return o.length?'\\x1b['+o.join(';')+'m'+t+'\\x1b[0m':t})`;
|
|
7
|
+
|
|
8
|
+
export async function load(url, context, nextLoad) {
|
|
9
|
+
const result = await nextLoad(url, context);
|
|
10
|
+
|
|
11
|
+
if (result.format === 'module' && result.source) {
|
|
12
|
+
let source = typeof result.source === 'string'
|
|
13
|
+
? result.source
|
|
14
|
+
: Buffer.from(result.source).toString('utf-8');
|
|
15
|
+
|
|
16
|
+
// Transform: const { styleText: X } = __rspack_external_node_util_XXXXX;
|
|
17
|
+
// Into: var X = typeof NAMESPACE.styleText === 'function'
|
|
18
|
+
// ? NAMESPACE.styleText
|
|
19
|
+
// : POLYFILL;
|
|
20
|
+
if (source.includes('__rspack_external_node_util') && source.includes('styleText')) {
|
|
21
|
+
source = source.replace(
|
|
22
|
+
/const \{ styleText: (\w+) \} = (__rspack_external_node_util_\w+);/g,
|
|
23
|
+
`var $1 = typeof $2.styleText === 'function' ? $2.styleText : ${STYLE_POLYFILL_FN};`
|
|
24
|
+
);
|
|
25
|
+
return { format: 'module', source };
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return result;
|
|
30
|
+
}
|
package/lib/cli/config/index.js
CHANGED
|
@@ -1,3 +1,156 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var path = require('path');
|
|
4
|
+
var fs = require('fs');
|
|
5
|
+
var utils_index = require('../utils/index.js');
|
|
6
|
+
var utils_getJavascriptfile = require('../utils/getJavascriptfile.js');
|
|
7
|
+
|
|
8
|
+
const DEFAULT_CONFIG_FILES = ['config/config.ts', 'config/config.js', 'config.ts', 'config.js'];
|
|
9
|
+
const pickNames = ['routes', 'microServiceMap', 'setting', 'define', 'optimization', 'provide', 'htmlTemplatePath'];
|
|
10
|
+
class Config {
|
|
11
|
+
opts;
|
|
12
|
+
mainConfigFile;
|
|
13
|
+
configFiles = [];
|
|
14
|
+
constructor(opts) {
|
|
15
|
+
const defaultConfigFiles = opts.defaultConfigFiles ? opts.defaultConfigFiles : DEFAULT_CONFIG_FILES;
|
|
16
|
+
this.mainConfigFile = Config.getMainConfigFile({
|
|
17
|
+
cwd: opts.cwd,
|
|
18
|
+
defaultConfigFiles: defaultConfigFiles,
|
|
19
|
+
});
|
|
20
|
+
this.opts = {
|
|
21
|
+
...opts,
|
|
22
|
+
defaultConfigFiles: defaultConfigFiles,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
getMsPagesUserConfig(cwd) {
|
|
26
|
+
const paths = typeof cwd === 'string' ? [cwd] : cwd;
|
|
27
|
+
let tempConfig = {};
|
|
28
|
+
paths.map(itemPath => {
|
|
29
|
+
const mainConfigFile = Config.getMainConfigFile({
|
|
30
|
+
cwd: itemPath,
|
|
31
|
+
defaultConfigFiles: this.opts.defaultConfigFiles,
|
|
32
|
+
});
|
|
33
|
+
const config = Config.getUserConfig({
|
|
34
|
+
cwd: itemPath,
|
|
35
|
+
mainConfigFile: mainConfigFile,
|
|
36
|
+
});
|
|
37
|
+
tempConfig = utils_index.mergeConfig(tempConfig, utils_index.pick(config, pickNames));
|
|
38
|
+
});
|
|
39
|
+
return tempConfig;
|
|
40
|
+
}
|
|
41
|
+
getMsUserConfig() {
|
|
42
|
+
this.configFiles = [];
|
|
43
|
+
let userConfig = Config.getUserConfig({
|
|
44
|
+
cwd: this.opts.cwd,
|
|
45
|
+
mainConfigFile: this.mainConfigFile,
|
|
46
|
+
});
|
|
47
|
+
this.mainConfigFile && this.configFiles.push(this.mainConfigFile);
|
|
48
|
+
const fileArray = [this.opts.cwd];
|
|
49
|
+
const srcPath = utils_index.getSrcPath();
|
|
50
|
+
utils_index.get(userConfig, 'mfa.pages', []);
|
|
51
|
+
const configAlias = utils_index.get(userConfig, 'alias', {});
|
|
52
|
+
const packages = utils_index.get(userConfig, 'packages', {});
|
|
53
|
+
const alias = {
|
|
54
|
+
'@gant': path.resolve(this.opts.cwd, srcPath, '.gant'),
|
|
55
|
+
'@@': path.resolve(this.opts.cwd),
|
|
56
|
+
...configAlias,
|
|
57
|
+
};
|
|
58
|
+
let tempConfig = {
|
|
59
|
+
context: this.opts.cwd,
|
|
60
|
+
publicPathDir: path.resolve(this.opts.cwd, srcPath, '.gant'),
|
|
61
|
+
resolve: {
|
|
62
|
+
alias: alias,
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
if (utils_index.isPlainObject(packages)) {
|
|
66
|
+
Object.keys(packages).map(name => {
|
|
67
|
+
const packagePath = packages[name];
|
|
68
|
+
if (fileArray.includes(packagePath))
|
|
69
|
+
return;
|
|
70
|
+
fileArray.push(packagePath);
|
|
71
|
+
const configFile = Config.getMainConfigFile({
|
|
72
|
+
cwd: packagePath,
|
|
73
|
+
defaultConfigFiles: this.opts.defaultConfigFiles,
|
|
74
|
+
});
|
|
75
|
+
configFile && this.configFiles.push(configFile);
|
|
76
|
+
const packageConfig = Config.getUserConfig({
|
|
77
|
+
cwd: packagePath,
|
|
78
|
+
mainConfigFile: configFile,
|
|
79
|
+
});
|
|
80
|
+
tempConfig = utils_index.mergeConfig(tempConfig, utils_index.pick(packageConfig, pickNames));
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
...utils_index.mergeConfig(tempConfig, userConfig),
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
getUserConfig() {
|
|
88
|
+
this.configFiles = [];
|
|
89
|
+
let userConfig = Config.getUserConfig({
|
|
90
|
+
cwd: this.opts.cwd,
|
|
91
|
+
mainConfigFile: this.mainConfigFile,
|
|
92
|
+
});
|
|
93
|
+
this.mainConfigFile && this.configFiles.push(this.mainConfigFile);
|
|
94
|
+
const fileArray = [this.opts.cwd];
|
|
95
|
+
const packages = utils_index.get(userConfig, 'packages', {});
|
|
96
|
+
const srcPath = utils_index.getSrcPath();
|
|
97
|
+
const alias = {
|
|
98
|
+
'@gant': path.resolve(this.opts.cwd, srcPath, '.gant'),
|
|
99
|
+
[userConfig.name || '@@']: path.resolve(this.opts.cwd),
|
|
100
|
+
...packages,
|
|
101
|
+
};
|
|
102
|
+
let tempConfig = {
|
|
103
|
+
context: this.opts.cwd,
|
|
104
|
+
resolve: {
|
|
105
|
+
alias: alias,
|
|
106
|
+
},
|
|
107
|
+
};
|
|
108
|
+
if (utils_index.isPlainObject(packages)) {
|
|
109
|
+
Object.keys(packages).map(name => {
|
|
110
|
+
const packagePath = packages[name];
|
|
111
|
+
if (fileArray.includes(packagePath))
|
|
112
|
+
return;
|
|
113
|
+
fileArray.push(packagePath);
|
|
114
|
+
const configFile = Config.getMainConfigFile({
|
|
115
|
+
cwd: packagePath,
|
|
116
|
+
defaultConfigFiles: this.opts.defaultConfigFiles,
|
|
117
|
+
});
|
|
118
|
+
configFile && this.configFiles.push(configFile);
|
|
119
|
+
const packageConfig = Config.getUserConfig({
|
|
120
|
+
cwd: packagePath,
|
|
121
|
+
mainConfigFile: configFile,
|
|
122
|
+
});
|
|
123
|
+
tempConfig = utils_index.mergeConfig(tempConfig, utils_index.pick(packageConfig, pickNames));
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
return {
|
|
127
|
+
...utils_index.mergeConfig(tempConfig, userConfig),
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
static getMainConfigFile(opts) {
|
|
131
|
+
let mainConfigFile = null;
|
|
132
|
+
for (const configFile of opts.defaultConfigFiles || DEFAULT_CONFIG_FILES) {
|
|
133
|
+
const absConfigFile = path.join(opts.cwd, configFile);
|
|
134
|
+
if (fs.existsSync(absConfigFile)) {
|
|
135
|
+
mainConfigFile = absConfigFile;
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return mainConfigFile;
|
|
140
|
+
}
|
|
141
|
+
static getUserConfig(opts) {
|
|
142
|
+
let config = {};
|
|
143
|
+
if (!opts.mainConfigFile)
|
|
144
|
+
return config;
|
|
145
|
+
try {
|
|
146
|
+
config = utils_getJavascriptfile.getJavascriptfile(utils_index.getAbsFile(opts.mainConfigFile, opts.cwd));
|
|
147
|
+
}
|
|
148
|
+
catch (error) {
|
|
149
|
+
console.log('getUserConfig Error :', error);
|
|
150
|
+
}
|
|
151
|
+
return config;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
exports.Config = Config;
|
|
3
156
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{resolve as i,join as t}from"path";import{existsSync as s}from"fs";import{m as e,p as n,g as o,a as g,i as f,b as a}from"../utils/index.mjs";import{g as l}from"../utils/getJavascriptfile.mjs";const c=["config/config.ts","config/config.js","config.ts","config.js"],r=["routes","microServiceMap","setting","define","optimization","provide","htmlTemplatePath"];class p{opts;mainConfigFile;configFiles=[];constructor(i){const t=i.defaultConfigFiles?i.defaultConfigFiles:c;this.mainConfigFile=p.getMainConfigFile({cwd:i.cwd,defaultConfigFiles:t}),this.opts={...i,defaultConfigFiles:t}}getMsPagesUserConfig(i){let t={};return("string"==typeof i?[i]:i).map(i=>{const s=p.getMainConfigFile({cwd:i,defaultConfigFiles:this.opts.defaultConfigFiles}),o=p.getUserConfig({cwd:i,mainConfigFile:s});t=e(t,n(o,r))}),t}getMsUserConfig(){this.configFiles=[];let t=p.getUserConfig({cwd:this.opts.cwd,mainConfigFile:this.mainConfigFile});this.mainConfigFile&&this.configFiles.push(this.mainConfigFile);const s=[this.opts.cwd],a=o();g(t,"mfa.pages",[]);const l=g(t,"alias",{}),c=g(t,"packages",{}),C={"@gant":i(this.opts.cwd,a,".gant"),"@@":i(this.opts.cwd),...l};let d={context:this.opts.cwd,publicPathDir:i(this.opts.cwd,a,".gant"),resolve:{alias:C}};return f(c)&&Object.keys(c).map(i=>{const t=c[i];if(s.includes(t))return;s.push(t);const o=p.getMainConfigFile({cwd:t,defaultConfigFiles:this.opts.defaultConfigFiles});o&&this.configFiles.push(o);const g=p.getUserConfig({cwd:t,mainConfigFile:o});d=e(d,n(g,r))}),{...e(d,t)}}getUserConfig(){this.configFiles=[];let t=p.getUserConfig({cwd:this.opts.cwd,mainConfigFile:this.mainConfigFile});this.mainConfigFile&&this.configFiles.push(this.mainConfigFile);const s=[this.opts.cwd],a=g(t,"packages",{}),l=o(),c={"@gant":i(this.opts.cwd,l,".gant"),[t.name||"@@"]:i(this.opts.cwd),...a};let C={context:this.opts.cwd,resolve:{alias:c}};return f(a)&&Object.keys(a).map(i=>{const t=a[i];if(s.includes(t))return;s.push(t);const o=p.getMainConfigFile({cwd:t,defaultConfigFiles:this.opts.defaultConfigFiles});o&&this.configFiles.push(o);const g=p.getUserConfig({cwd:t,mainConfigFile:o});C=e(C,n(g,r))}),{...e(C,t)}}static getMainConfigFile(i){let e=null;for(const n of i.defaultConfigFiles||c){const o=t(i.cwd,n);if(s(o)){e=o;break}}return e}static getUserConfig(i){let t={};if(!i.mainConfigFile)return t;try{t=l(a(i.mainConfigFile,i.cwd))}catch(i){console.log("getUserConfig Error :",i)}return t}}export{p as C};
|
|
3
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,3 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var path = require('path');
|
|
4
|
+
var utils_index = require('../utils/index.js');
|
|
5
|
+
var fs = require('fs');
|
|
6
|
+
|
|
7
|
+
const copyAppsFiles = (tempPath, packagesPaths) => {
|
|
8
|
+
let AppContent = '';
|
|
9
|
+
//复制public 并前置项目模块中的app文件
|
|
10
|
+
const APP_CONFIG_FILES = ['app.ts', 'app.tsx', 'app.js'];
|
|
11
|
+
packagesPaths.map((packagePath, index) => {
|
|
12
|
+
for (const fileName of APP_CONFIG_FILES) {
|
|
13
|
+
const appPath = path.resolve(packagePath, fileName);
|
|
14
|
+
if (fs.existsSync(appPath)) {
|
|
15
|
+
// 使用 path.posix 生成一致的路径分隔符
|
|
16
|
+
const normalizedAppPath = appPath.split(path.sep).join(path.posix.sep);
|
|
17
|
+
return (AppContent += `import '${normalizedAppPath}';\n`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
// 确保 tempPath 已经被正确定义
|
|
22
|
+
const targetPath = path.resolve(tempPath, 'app.ts');
|
|
23
|
+
utils_index.writeFileToJS(targetPath, AppContent);
|
|
24
|
+
};
|
|
25
|
+
const copyPublicFiles = (tempPath, publicPaths) => {
|
|
26
|
+
//复制public 并前置项目模块中的app文件
|
|
27
|
+
publicPaths?.map((path$1, index) => {
|
|
28
|
+
utils_index.copyFolder(path$1, path.resolve(tempPath, 'public'));
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
exports.copyAppsFiles = copyAppsFiles;
|
|
33
|
+
exports.copyPublicFiles = copyPublicFiles;
|
|
3
34
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import s,{resolve as p}from"path";import{w as t,c as o}from"../utils/index.mjs";import a from"fs";const i=(o,i)=>{let r="";const n=["app.ts","app.tsx","app.js"];i.map((t,o)=>{for(const o of n){const i=p(t,o);if(a.existsSync(i)){const p=i.split(s.sep).join(s.posix.sep);return r+=`import '${p}';\n`}}});const c=s.resolve(o,"app.ts");t(c,r)},r=(s,t)=>{t?.map((t,a)=>{o(t,p(s,"public"))})};export{r as a,i as c};
|
|
3
|
+
//# sourceMappingURL=index.mjs.map
|