fix(build): switch from umd to cjs format to support dual entry points
Vite does not allow multiple entry points with umd/iife output formats. Switching to es+cjs enables the private/ sub-package build. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
这个提交包含在:
父节点
7054cb7c4f
当前提交
b25ae21760
@ -6,19 +6,19 @@
|
|||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"registry": "https://nexus.xuqinmin.com/repository/npm-hosted/"
|
"registry": "https://nexus.xuqinmin.com/repository/npm-hosted/"
|
||||||
},
|
},
|
||||||
"main": "dist/index.umd.js",
|
"main": "dist/index.cjs.js",
|
||||||
"module": "dist/index.es.js",
|
"module": "dist/index.es.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": {
|
".": {
|
||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/index.d.ts",
|
||||||
"import": "./dist/index.es.js",
|
"import": "./dist/index.es.js",
|
||||||
"require": "./dist/index.umd.js"
|
"require": "./dist/index.cjs.js"
|
||||||
},
|
},
|
||||||
"./private": {
|
"./private": {
|
||||||
"types": "./dist/private/index.d.ts",
|
"types": "./dist/private/index.d.ts",
|
||||||
"import": "./dist/private/index.es.js",
|
"import": "./dist/private/index.es.js",
|
||||||
"require": "./dist/private/index.umd.js"
|
"require": "./dist/private/index.cjs.js"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
|
|||||||
@ -6,14 +6,14 @@
|
|||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"registry": "https://nexus.xuqinmin.com/repository/npm-hosted/"
|
"registry": "https://nexus.xuqinmin.com/repository/npm-hosted/"
|
||||||
},
|
},
|
||||||
"main": "dist/private/index.umd.js",
|
"main": "dist/private/index.cjs.js",
|
||||||
"module": "dist/private/index.es.js",
|
"module": "dist/private/index.es.js",
|
||||||
"types": "dist/private/index.d.ts",
|
"types": "dist/private/index.d.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": {
|
".": {
|
||||||
"types": "./dist/private/index.d.ts",
|
"types": "./dist/private/index.d.ts",
|
||||||
"import": "./dist/private/index.es.js",
|
"import": "./dist/private/index.es.js",
|
||||||
"require": "./dist/private/index.umd.js"
|
"require": "./dist/private/index.cjs.js"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
|
|||||||
@ -11,7 +11,7 @@ export default defineConfig({
|
|||||||
'private/index': resolve(__dirname, 'src/private/index.ts'),
|
'private/index': resolve(__dirname, 'src/private/index.ts'),
|
||||||
},
|
},
|
||||||
name: 'XuqmH5SDK',
|
name: 'XuqmH5SDK',
|
||||||
formats: ['es', 'umd'],
|
formats: ['es', 'cjs'],
|
||||||
fileName: (format, entryName) => `${entryName}.${format}.js`,
|
fileName: (format, entryName) => `${entryName}.${format}.js`,
|
||||||
},
|
},
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
|
|||||||
正在加载...
在新工单中引用
屏蔽一个用户