Match-id-f33f05f9e3da93aae011aa3682b0f1a457c62ea1

This commit is contained in:
* 2023-01-03 20:39:22 +08:00 committed by *
commit 036bf359c3
4 changed files with 11 additions and 4 deletions

View File

@ -1,3 +1,6 @@
## 0.0.30 (2023-01-03)
- **CI**: 生成态输出文件改为horiozn.producion.min.js
## 0.0.26 (2022-11-09) ## 0.0.26 (2022-11-09)
- **CI**: 包信息同步CMC - **CI**: 包信息同步CMC

View File

@ -4,7 +4,7 @@
"keywords": [ "keywords": [
"horizon" "horizon"
], ],
"version": "0.0.26", "version": "0.0.30",
"homepage": "", "homepage": "",
"bugs": "", "bugs": "",
"main": "index.js", "main": "index.js",

View File

@ -108,7 +108,7 @@ window.addEventListener('message', messageEvent => {
} }
// executes store action // executes store action
if (messageEvent.data.payload.type === 'horizonx executue action') { if (messageEvent.data?.payload?.type === 'horizonx executue action') {
const data = messageEvent.data.payload.data; const data = messageEvent.data.payload.data;
const store = getStore(data.storeId); const store = getStore(data.storeId);
if (!store?.[data.action]) return; if (!store?.[data.action]) return;

View File

@ -38,6 +38,10 @@ if (!fs.existsSync(outDir)) {
const outputResolve = (...p) => path.resolve(outDir, ...p); const outputResolve = (...p) => path.resolve(outDir, ...p);
function getOutputName(mode) {
return mode === 'production' ? `horizon.${mode}.min.js` : `horizon.${mode}.js`;
}
function genConfig(mode) { function genConfig(mode) {
const isDev = mode === 'development'; const isDev = mode === 'development';
const sourcemap = isDev ? 'inline' : false; const sourcemap = isDev ? 'inline' : false;
@ -45,12 +49,12 @@ function genConfig(mode) {
input: path.resolve(libDir, 'index.ts'), input: path.resolve(libDir, 'index.ts'),
output: [ output: [
{ {
file: outputResolve('cjs', `horizon.${mode}.js`), file: outputResolve('cjs', getOutputName(mode)),
sourcemap, sourcemap,
format: 'cjs', format: 'cjs',
}, },
{ {
file: outputResolve('umd', `horizon.${mode}.js`), file: outputResolve('umd', getOutputName(mode)),
sourcemap, sourcemap,
name: 'Horizon', name: 'Horizon',
format: 'umd', format: 'umd',