@zxiaosi/sdk 0.0.1 → 0.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/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.mjs.map +1 -1
- package/package.json +9 -3
- package/rolldown.config.ts +78 -78
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/index.ts"],"sourcesContent":["const hello = 'hello world';\
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/index.ts"],"sourcesContent":["const hello = 'hello world';\n\nconsole.log(hello);\n\nexport default hello;\n"],"mappings":"AAAA,MAAM,EAAQ,cAEd,QAAQ,IAAI,EAAM,CAElB,IAAA,EAAe"}
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/index.ts"],"sourcesContent":["const hello = 'hello world';\
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/index.ts"],"sourcesContent":["const hello = 'hello world';\n\nconsole.log(hello);\n\nexport default hello;\n"],"mappings":"AAAA,MAAM,EAAQ,cAEd,QAAQ,IAAI,EAAM,CAElB,IAAA,EAAe"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zxiaosi/sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "A micro frontend kit",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/zxiaosi-team/fontend-sdk.git",
|
|
8
|
+
"directory": "sdk"
|
|
9
|
+
},
|
|
5
10
|
"license": "MIT",
|
|
6
11
|
"author": "zxiaosi",
|
|
7
12
|
"type": "module",
|
|
@@ -15,7 +20,7 @@
|
|
|
15
20
|
],
|
|
16
21
|
"scripts": {
|
|
17
22
|
"build": "npx rimraf dist && rolldown -c rolldown.config.ts",
|
|
18
|
-
"publish": "npm
|
|
23
|
+
"publish": "npm publish"
|
|
19
24
|
},
|
|
20
25
|
"dependencies": {
|
|
21
26
|
"@ant-design/pro-layout": "^7.22.7",
|
|
@@ -45,6 +50,7 @@
|
|
|
45
50
|
"zustand": "^5.0.8"
|
|
46
51
|
},
|
|
47
52
|
"publishConfig": {
|
|
48
|
-
"access": "public"
|
|
53
|
+
"access": "public",
|
|
54
|
+
"registry": "https://registry.npmjs.org/"
|
|
49
55
|
}
|
|
50
56
|
}
|
package/rolldown.config.ts
CHANGED
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
import babel, { RollupBabelInputPluginOptions } from '@rollup/plugin-babel';
|
|
2
|
-
import { defineConfig } from 'rolldown';
|
|
3
|
-
import { dts } from 'rolldown-plugin-dts';
|
|
4
|
-
import nodeExternals from 'rollup-plugin-node-externals';
|
|
5
|
-
|
|
6
|
-
/** babel 配置 */
|
|
7
|
-
const babelOptions: RollupBabelInputPluginOptions = {
|
|
8
|
-
presets: [
|
|
9
|
-
[
|
|
10
|
-
'@babel/preset-env',
|
|
11
|
-
{
|
|
12
|
-
modules: false, // 不转换模块语法, 让 Rollup 处理模块语法
|
|
13
|
-
targets: {
|
|
14
|
-
node: 'current', // 当前 Node.js 版本
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
],
|
|
18
|
-
'@babel/preset-react',
|
|
19
|
-
], // 使用 React 和 ES6+ 预设
|
|
20
|
-
exclude: 'node_modules/**', // 排除 node_modules 中的文件
|
|
21
|
-
babelHelpers: 'bundled', // 使用打包的 Babel 辅助函数, 避免重复打包
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
/** 通用配置 */
|
|
25
|
-
const common = defineConfig({
|
|
26
|
-
input: './src/index.ts',
|
|
27
|
-
platform: 'browser', // 作用于浏览器环境
|
|
28
|
-
tsconfig: './tsconfig.json', // 指定 tsconfig 文件
|
|
29
|
-
output: {
|
|
30
|
-
sourcemap: true, // 生成 sourcemap 文件
|
|
31
|
-
minify: true, // 启用代码压缩, 调试时可以关闭
|
|
32
|
-
},
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
const config = defineConfig([
|
|
36
|
-
{
|
|
37
|
-
...common,
|
|
38
|
-
plugins: [
|
|
39
|
-
nodeExternals(), // 排除 deps、peerDeps 中的依赖
|
|
40
|
-
babel(babelOptions),
|
|
41
|
-
dts(),
|
|
42
|
-
],
|
|
43
|
-
output: {
|
|
44
|
-
dir: 'dist/esm',
|
|
45
|
-
format: 'es',
|
|
46
|
-
entryFileNames: '[name].mjs',
|
|
47
|
-
chunkFileNames: '[name]-[hash].mjs',
|
|
48
|
-
...common.output,
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
...common,
|
|
53
|
-
plugins: [
|
|
54
|
-
nodeExternals(), // 排除 deps、peerDeps 中的依赖
|
|
55
|
-
babel(babelOptions),
|
|
56
|
-
],
|
|
57
|
-
output: {
|
|
58
|
-
dir: 'dist/cjs',
|
|
59
|
-
format: 'cjs',
|
|
60
|
-
entryFileNames: '[name].cjs',
|
|
61
|
-
chunkFileNames: '[name]-[hash].cjs',
|
|
62
|
-
...common.output,
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
...common,
|
|
67
|
-
plugins: [dts({ emitDtsOnly: true })],
|
|
68
|
-
output: {
|
|
69
|
-
dir: 'dist/cjs',
|
|
70
|
-
format: 'esm',
|
|
71
|
-
entryFileNames: '[name].cjs',
|
|
72
|
-
chunkFileNames: '[name]-[hash].cjs',
|
|
73
|
-
...common.output,
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
]);
|
|
77
|
-
|
|
78
|
-
export default config;
|
|
1
|
+
import babel, { RollupBabelInputPluginOptions } from '@rollup/plugin-babel';
|
|
2
|
+
import { defineConfig } from 'rolldown';
|
|
3
|
+
import { dts } from 'rolldown-plugin-dts';
|
|
4
|
+
import nodeExternals from 'rollup-plugin-node-externals';
|
|
5
|
+
|
|
6
|
+
/** babel 配置 */
|
|
7
|
+
const babelOptions: RollupBabelInputPluginOptions = {
|
|
8
|
+
presets: [
|
|
9
|
+
[
|
|
10
|
+
'@babel/preset-env',
|
|
11
|
+
{
|
|
12
|
+
modules: false, // 不转换模块语法, 让 Rollup 处理模块语法
|
|
13
|
+
targets: {
|
|
14
|
+
node: 'current', // 当前 Node.js 版本
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
'@babel/preset-react',
|
|
19
|
+
], // 使用 React 和 ES6+ 预设
|
|
20
|
+
exclude: 'node_modules/**', // 排除 node_modules 中的文件
|
|
21
|
+
babelHelpers: 'bundled', // 使用打包的 Babel 辅助函数, 避免重复打包
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/** 通用配置 */
|
|
25
|
+
const common = defineConfig({
|
|
26
|
+
input: './src/index.ts',
|
|
27
|
+
platform: 'browser', // 作用于浏览器环境
|
|
28
|
+
tsconfig: './tsconfig.json', // 指定 tsconfig 文件
|
|
29
|
+
output: {
|
|
30
|
+
sourcemap: true, // 生成 sourcemap 文件
|
|
31
|
+
minify: true, // 启用代码压缩, 调试时可以关闭
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const config = defineConfig([
|
|
36
|
+
{
|
|
37
|
+
...common,
|
|
38
|
+
plugins: [
|
|
39
|
+
nodeExternals(), // 排除 deps、peerDeps 中的依赖
|
|
40
|
+
babel(babelOptions),
|
|
41
|
+
dts(),
|
|
42
|
+
],
|
|
43
|
+
output: {
|
|
44
|
+
dir: 'dist/esm',
|
|
45
|
+
format: 'es',
|
|
46
|
+
entryFileNames: '[name].mjs',
|
|
47
|
+
chunkFileNames: '[name]-[hash].mjs',
|
|
48
|
+
...common.output,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
...common,
|
|
53
|
+
plugins: [
|
|
54
|
+
nodeExternals(), // 排除 deps、peerDeps 中的依赖
|
|
55
|
+
babel(babelOptions),
|
|
56
|
+
],
|
|
57
|
+
output: {
|
|
58
|
+
dir: 'dist/cjs',
|
|
59
|
+
format: 'cjs',
|
|
60
|
+
entryFileNames: '[name].cjs',
|
|
61
|
+
chunkFileNames: '[name]-[hash].cjs',
|
|
62
|
+
...common.output,
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
...common,
|
|
67
|
+
plugins: [dts({ emitDtsOnly: true })],
|
|
68
|
+
output: {
|
|
69
|
+
dir: 'dist/cjs',
|
|
70
|
+
format: 'esm',
|
|
71
|
+
entryFileNames: '[name].cjs',
|
|
72
|
+
chunkFileNames: '[name]-[hash].cjs',
|
|
73
|
+
...common.output,
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
]);
|
|
77
|
+
|
|
78
|
+
export default config;
|