create-alemonjs 0.0.7 → 0.0.8
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/package.json
CHANGED
|
@@ -1,18 +1,27 @@
|
|
|
1
1
|
import { defineConfig } from 'lvyjs';
|
|
2
|
-
import { fileURLToPath } from 'url';
|
|
3
2
|
import { dirname, join } from 'path';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
4
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
5
|
-
const includes = (value: string) => process.argv.includes(value);
|
|
6
|
-
const alemonjs = () => import('alemonjs').then(res => res.start('src/index.ts'));
|
|
7
|
-
const jsxp = () => import('jsxp').then(res => res.createServer());
|
|
8
5
|
export default defineConfig({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
if (includes('--view')) return jsxp;
|
|
12
|
-
return alemonjs;
|
|
13
|
-
}
|
|
6
|
+
watch: [
|
|
7
|
+
'src/**/*.{ts,tsx,js,jsx,json,html}'
|
|
14
8
|
],
|
|
15
9
|
alias: {
|
|
16
10
|
entries: [{ find: '@src', replacement: join(__dirname, 'src') }]
|
|
11
|
+
},
|
|
12
|
+
assets: {
|
|
13
|
+
// 支持图片、字体、文本等静态资源
|
|
14
|
+
filter: /\.(png|jpg|jpeg|gif|svg|webp|ico|yaml|txt|ttf|md)$/
|
|
15
|
+
},
|
|
16
|
+
build: {
|
|
17
|
+
typescript: {
|
|
18
|
+
// 仅打包src目
|
|
19
|
+
include: ['src/**/*.ts', 'src/**/*.tsx'],
|
|
20
|
+
// 输出目录
|
|
21
|
+
outDir: 'lib',
|
|
22
|
+
removeComments: true,
|
|
23
|
+
// 生成声明文件
|
|
24
|
+
declaration: true
|
|
25
|
+
}
|
|
17
26
|
}
|
|
18
27
|
});
|
|
@@ -3,18 +3,17 @@ const yaml = require('yaml');
|
|
|
3
3
|
|
|
4
4
|
let pm2 = null;
|
|
5
5
|
try {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
console.error('Error parsing YAML configuration:', error);
|
|
6
|
+
// Read and parse the YAML configuration file
|
|
7
|
+
const data = fs.readFileSync('./alemon.config.yaml', 'utf8');
|
|
8
|
+
const config = yaml.parse(data);
|
|
9
|
+
pm2 = config?.pm2 ?? {};
|
|
10
|
+
} catch (error) {
|
|
11
|
+
console.error('Error parsing YAML configuration:', error);
|
|
13
12
|
}
|
|
14
13
|
|
|
15
14
|
/**
|
|
16
15
|
* @type {{ apps: import("pm2").StartOptions[] }}
|
|
17
16
|
*/
|
|
18
17
|
module.exports = pm2 || {
|
|
19
|
-
|
|
20
|
-
}
|
|
18
|
+
apps: []
|
|
19
|
+
};
|