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)
- **CI**: 包信息同步CMC

View File

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

View File

@ -108,7 +108,7 @@ window.addEventListener('message', messageEvent => {
}
// 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 store = getStore(data.storeId);
if (!store?.[data.action]) return;

View File

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