diff --git a/packages/designer/src/builtin-simulator/host.ts b/packages/designer/src/builtin-simulator/host.ts index 544abdc7f..0a7f9d950 100644 --- a/packages/designer/src/builtin-simulator/host.ts +++ b/packages/designer/src/builtin-simulator/host.ts @@ -144,6 +144,10 @@ export class BuiltinSimulatorHost implements ISimulatorHost { + const distFile = join(distDir, 'js', name); + if (!fse.existsSync(distFile)) { + console.warn(`[engine] distFile: ${distFile} doesn\'t exist`); + return; + } -const indexContent = fse.readFileSync(distFile, 'utf-8'); + const indexContent = fse.readFileSync(distFile, 'utf-8'); -fse.writeFileSync(distFile, indexContent.replace('{{VERSION_PLACEHOLDER}}', releaseVersion)); + fse.writeFileSync(distFile, indexContent.replace('{{VERSION_PLACEHOLDER}}', releaseVersion)); +}); + +console.log('[engine] update engine version successfully!'); diff --git a/packages/ignitor/build.json b/packages/ignitor/build.json index b05041299..02cfe5fb3 100644 --- a/packages/ignitor/build.json +++ b/packages/ignitor/build.json @@ -9,6 +9,7 @@ }, "vendor": false, "devServer": { + "useLocalIp": true, "hot": false }, "publicPath": "/", diff --git a/packages/plugin-designer/src/index.tsx b/packages/plugin-designer/src/index.tsx index 5ba587bb8..d8c1d35b7 100644 --- a/packages/plugin-designer/src/index.tsx +++ b/packages/plugin-designer/src/index.tsx @@ -14,6 +14,7 @@ interface DesignerPluginState { extraEnvironment?: any[] | null; renderEnv?: string; device?: string; + locale?: string; designMode?: string; deviceClassName?: string; simulatorUrl: Asset | null; @@ -30,6 +31,7 @@ export default class DesignerPlugin extends PureComponent { - const newCtx = { - ...this._appContext, - }; - newCtx.utils.i18n.currentLocale = loc; - this._appContext = newCtx; + this._appContext.utils.i18n.currentLocale = loc; + this._locale = loc; }, - currentLocale: undefined, + currentLocale: this.locale, messages: {}, }, }, @@ -321,7 +320,7 @@ export class SimulatorRendererContainer implements BuiltinSimulatorRenderer { return this._components; } // context from: utils、constants、history、location、match - @obx.ref private _appContext = {}; + @obx.ref private _appContext: any = {}; @computed get context(): any { return this._appContext; } @@ -333,6 +332,10 @@ export class SimulatorRendererContainer implements BuiltinSimulatorRenderer { @computed get device() { return this._device; } + @obx.ref private _locale: string = ''; + @computed get locale() { + return this._locale; + } @obx.ref private _componentsMap = {}; @computed get componentsMap(): any { return this._componentsMap; diff --git a/packages/vision-polyfill/build.cloud.json b/packages/vision-polyfill/build.cloud.json index 7b3143b76..3e8dd9a02 100644 --- a/packages/vision-polyfill/build.cloud.json +++ b/packages/vision-polyfill/build.cloud.json @@ -15,19 +15,19 @@ "monaco-editor/esm/vs/editor/editor.main.js": "var window.monaco", "@ali/lowcode-engine": "var window.AliLowCodeEngine", "@ali/lowcode-engine-ext": "var window.AliLowCodeEngineExt", + "@alifd/next": "var Next", "moment": "var moment", "lodash": "var _" }, - "browserslist": { - "chrome": 80 - }, + "polyfill": false, "outputDir": "dist", "vendor": false, "ignoreHtmlTemplate": true, "sourceMap": true, "plugins": [ "build-plugin-react-app", - "build-plugin-fusion", + ["build-plugin-fusion", { + }], ["build-plugin-moment-locales", { "locales": ["zh-cn"] }],