mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-12 08:58:15 +00:00
feat: react-renderer生成umd模块并上传cdn
This commit is contained in:
commit
23cd239f43
@ -379,7 +379,7 @@ export class Prop implements IPropParent {
|
||||
/**
|
||||
* 构造 items 属性,同时构造 maps 属性
|
||||
*/
|
||||
@computed private get items(): Prop[] | null {
|
||||
private get items(): Prop[] | null {
|
||||
if (this._items) return this._items;
|
||||
return runInAction(() => {
|
||||
let items: Prop[] | null = null;
|
||||
@ -617,9 +617,11 @@ export class Prop implements IPropParent {
|
||||
if (this._items) {
|
||||
this._items.forEach((item) => item.purge());
|
||||
}
|
||||
this._items = null;
|
||||
this._maps = null;
|
||||
if (this._slotNode && this._slotNode.slotFor === this) {
|
||||
this._slotNode.remove();
|
||||
this._slotNode = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,24 +1,6 @@
|
||||
{
|
||||
"plugins": [
|
||||
[
|
||||
"build-plugin-component",
|
||||
{
|
||||
"filename": "engine",
|
||||
"library": "___AliLowCodeEngine___",
|
||||
"libraryTarget": "umd",
|
||||
"externals": {
|
||||
"react": "var window.React",
|
||||
"react-dom": "var window.ReactDOM",
|
||||
"prop-types": "var window.PropTypes",
|
||||
"@ali/visualengine": "var window.VisualEngine",
|
||||
"@ali/visualengine-utils": "var window.VisualEngineUtils",
|
||||
"@ali/lowcode-engine-ext": "var window.AliLowCodeEngineExt",
|
||||
"rax": "var window.Rax",
|
||||
"monaco-editor/esm/vs/editor/editor.api": "var window.monaco",
|
||||
"monaco-editor/esm/vs/editor/editor.main.js": "var window.monaco"
|
||||
}
|
||||
}
|
||||
],
|
||||
"build-plugin-component",
|
||||
[
|
||||
"build-plugin-fusion",
|
||||
{
|
||||
@ -26,9 +8,12 @@
|
||||
"externalNext": "umd"
|
||||
}
|
||||
],
|
||||
["build-plugin-moment-locales", {
|
||||
"locales": ["zh-cn"]
|
||||
}],
|
||||
[
|
||||
"build-plugin-moment-locales",
|
||||
{
|
||||
"locales": ["zh-cn"]
|
||||
}
|
||||
],
|
||||
"./build.plugin.js"
|
||||
]
|
||||
}
|
||||
|
||||
38
packages/rax-simulator-renderer/build.cloud.json
Normal file
38
packages/rax-simulator-renderer/build.cloud.json
Normal file
@ -0,0 +1,38 @@
|
||||
{
|
||||
"entry": {
|
||||
"rax-simulator-renderer": "src/index"
|
||||
},
|
||||
"sourceMap": true,
|
||||
"library": "___RaxSimulatorRenderer___",
|
||||
"libraryTarget": "umd",
|
||||
"externals": {
|
||||
"react": "var window.React",
|
||||
"react-dom": "var window.ReactDOM",
|
||||
"prop-types": "var window.PropTypes",
|
||||
"@alifd/next": "var Next",
|
||||
"@ali/lowcode-engine-ext": "var window.AliLowCodeEngineExt",
|
||||
"rax": "var window.Rax",
|
||||
"moment": "var moment",
|
||||
"lodash": "var _"
|
||||
},
|
||||
"polyfill": false,
|
||||
"outputDir": "dist",
|
||||
"vendor": false,
|
||||
"ignoreHtmlTemplate": true,
|
||||
"plugins": [
|
||||
"build-plugin-react-app",
|
||||
[
|
||||
"build-plugin-fusion",
|
||||
{
|
||||
"externalNext": "umd"
|
||||
}
|
||||
],
|
||||
[
|
||||
"build-plugin-moment-locales",
|
||||
{
|
||||
"locales": ["zh-cn"]
|
||||
}
|
||||
],
|
||||
"./build.plugin.js"
|
||||
]
|
||||
}
|
||||
@ -1,21 +1,3 @@
|
||||
{
|
||||
"sourceMap": true,
|
||||
"plugins": [
|
||||
[
|
||||
"build-plugin-component",
|
||||
{
|
||||
"filename": "rax-simulator-renderer",
|
||||
"library": "SimulatorRenderer",
|
||||
"libraryExport": "default",
|
||||
"libraryTarget": "umd",
|
||||
"externals": {
|
||||
"react": "var window.React",
|
||||
"react-dom": "var window.ReactDOM",
|
||||
"prop-types": "var window.PropTypes",
|
||||
"rax": "var window.Rax"
|
||||
}
|
||||
}
|
||||
],
|
||||
"./build.plugin.js"
|
||||
]
|
||||
"plugins": ["build-plugin-component", "./build.plugin.js"]
|
||||
}
|
||||
|
||||
@ -7,8 +7,8 @@
|
||||
"license": "MIT",
|
||||
"files": [],
|
||||
"scripts": {
|
||||
"build": "NODE_OPTIONS=--max_old_space_size=8192 build-scripts build",
|
||||
"cloud-build": "build-scripts build --skip-demo"
|
||||
"build": "NODE_OPTIONS=--max_old_space_size=8192 build-scripts build --skip-demo",
|
||||
"cloud-build": "build-scripts build --config build.cloud.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ali/lowcode-designer": "1.0.76",
|
||||
|
||||
@ -2,12 +2,14 @@
|
||||
"entry": {
|
||||
"react-renderer": "src/index"
|
||||
},
|
||||
"sourceMap": true,
|
||||
"library": "___AliLowCodeReactRenderer___",
|
||||
"libraryTarget": "umd",
|
||||
"externals": {
|
||||
"react": "var window.React",
|
||||
"react-dom": "var window.ReactDOM",
|
||||
"prop-types": "var window.PropTypes",
|
||||
"@alifd/next": "var Next",
|
||||
"moment": "var window.moment"
|
||||
},
|
||||
"polyfill": false,
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
"react": "var window.React",
|
||||
"react-dom": "var window.ReactDOM",
|
||||
"prop-types": "var window.PropTypes",
|
||||
"@alifd/next": "var Next",
|
||||
"moment": "var window.moment"
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,7 +11,8 @@
|
||||
"scripts": {
|
||||
"test": "build-scripts test --config build.test.json",
|
||||
"start": "build-scripts start",
|
||||
"build": "build-scripts build --skip-demo"
|
||||
"build": "build-scripts build --skip-demo",
|
||||
"cloud-build": "NODE_OPTIONS=--max_old_space_size=8192 build-scripts build --config build.cloud.json"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
@ -2,17 +2,13 @@
|
||||
"entry": {
|
||||
"react-simulator-renderer": "src/index"
|
||||
},
|
||||
"sourceMap": true,
|
||||
"library": "___ReactSimulatorRenderer___",
|
||||
"libraryTarget": "umd",
|
||||
"externals": {
|
||||
"react": "var window.React",
|
||||
"react-dom": "var window.ReactDOM",
|
||||
"prop-types": "var window.PropTypes",
|
||||
"@ali/visualengine": "var window.VisualEngine",
|
||||
"@ali/visualengine-utils": "var window.VisualEngineUtils",
|
||||
"rax": "var window.Rax",
|
||||
"monaco-editor/esm/vs/editor/editor.api": "var window.monaco",
|
||||
"monaco-editor/esm/vs/editor/editor.main.js": "var window.monaco",
|
||||
"@alifd/next": "var Next",
|
||||
"@ali/lowcode-engine-ext": "var window.AliLowCodeEngineExt",
|
||||
"moment": "var moment",
|
||||
@ -24,12 +20,18 @@
|
||||
"ignoreHtmlTemplate": true,
|
||||
"plugins": [
|
||||
"build-plugin-react-app",
|
||||
["build-plugin-fusion", {
|
||||
"externalNext": "umd"
|
||||
}],
|
||||
["build-plugin-moment-locales", {
|
||||
"locales": ["zh-cn"]
|
||||
}],
|
||||
[
|
||||
"build-plugin-fusion",
|
||||
{
|
||||
"externalNext": "umd"
|
||||
}
|
||||
],
|
||||
[
|
||||
"build-plugin-moment-locales",
|
||||
{
|
||||
"locales": ["zh-cn"]
|
||||
}
|
||||
],
|
||||
"./build.plugin.js"
|
||||
]
|
||||
}
|
||||
|
||||
@ -1,15 +1,3 @@
|
||||
{
|
||||
"sourceMap": true,
|
||||
"plugins": [
|
||||
[
|
||||
"build-plugin-component",
|
||||
{
|
||||
"filename": "react-simulator-renderer",
|
||||
"library": "SimulatorRenderer",
|
||||
"libraryExport": "default",
|
||||
"libraryTarget": "umd"
|
||||
}
|
||||
],
|
||||
"./build.plugin.js"
|
||||
]
|
||||
"plugins": ["build-plugin-component", "./build.plugin.js"]
|
||||
}
|
||||
|
||||
@ -10,7 +10,8 @@
|
||||
"lib"
|
||||
],
|
||||
"scripts": {
|
||||
"cloud-build": "NODE_OPTIONS=--max_old_space_size=8192 build-scripts build --skip-demo"
|
||||
"build": "NODE_OPTIONS=--max_old_space_size=8192 build-scripts build --skip-demo",
|
||||
"cloud-build": "NODE_OPTIONS=--max_old_space_size=8192 build-scripts build --config build.cloud.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ali/lowcode-designer": "1.0.76",
|
||||
|
||||
@ -1,35 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
WORK_DIR=$PWD
|
||||
BUILD_DEST=$1
|
||||
|
||||
echo "Deploy ${PWD} -> ${BUILD_DEST} ..."
|
||||
|
||||
# build globals
|
||||
echo "build globals"
|
||||
cd packages/globals
|
||||
tnpm ii
|
||||
tnpm run cloud-build
|
||||
cd $WORK_DIR
|
||||
|
||||
# build simulator-renderer
|
||||
echo "build simulator-renderer"
|
||||
cd packages/react-simulator-renderer
|
||||
tnpm ii
|
||||
tnpm run cloud-build
|
||||
cd $WORK_DIR
|
||||
|
||||
# build lowcode demo
|
||||
echo "build lowcode demo"
|
||||
cd packages/demo
|
||||
# FIXME! npm is slow, but tnpm has a depends bug
|
||||
npm i --registry=http://registry.npm.alibaba-inc.com
|
||||
npm run cloud-build
|
||||
cd $WORK_DIR
|
||||
|
||||
mv packages/demo/build $BUILD_DEST
|
||||
mv packages/react-simulator-renderer/dist/* $BUILD_DEST
|
||||
mv packages/globals/dist/* $BUILD_DEST
|
||||
|
||||
cp deploy-space/html/* $BUILD_DEST
|
||||
echo "complete"
|
||||
@ -29,17 +29,13 @@ tnpm run setup
|
||||
|
||||
lerna run cloud-build --stream
|
||||
|
||||
|
||||
# mv deploy-space/packages/demo/build $BUILD_DEST
|
||||
mv ./packages/react-simulator-renderer/dist/* $BUILD_DEST
|
||||
mv ./packages/rax-simulator-renderer/dist/* $BUILD_DEST
|
||||
mv ./packages/react-renderer/dist/* $BUILD_DEST
|
||||
# mv deploy-space/packages/editor-preset-vision/dist/* $BUILD_DEST
|
||||
mv ./packages/react-simulator-renderer/dist/js/* $BUILD_DEST
|
||||
mv ./packages/react-simulator-renderer/dist/css/* $BUILD_DEST
|
||||
mv ./packages/rax-simulator-renderer/dist/js/* $BUILD_DEST
|
||||
mv ./packages/rax-simulator-renderer/dist/css/* $BUILD_DEST
|
||||
mv ./packages/engine/dist/js/* $BUILD_DEST
|
||||
mv ./packages/engine/dist/css/* $BUILD_DEST
|
||||
# mv ./packages/vision-polyfill/dist/js/* $BUILD_DEST
|
||||
# mv ./packages/vision-polyfill/dist/css/* $BUILD_DEST
|
||||
# mv deploy-space/packages/editor-preset-general/dist/* $BUILD_DEST
|
||||
# cp deploy-space/static/* $BUILD_DEST
|
||||
mv ./packages/react-renderer/dist/js/* $BUILD_DEST
|
||||
mv ./packages/react-renderer/dist/css/* $BUILD_DEST
|
||||
|
||||
echo "Complete"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user