From 446ff98ba75ebf0407e08441c2a282d72250c86c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8A=9B=E7=9A=93?= Date: Fri, 4 Dec 2020 16:36:07 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E5=A2=9E=E5=8A=A0=20ignitor(=E7=82=B9?= =?UTF-8?q?=E7=81=AB=E5=99=A8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/ignitor/build.json | 43 ++++++++++++++++++++++++++++++++ packages/ignitor/build.plugin.js | 16 ++++++++++++ scripts/start.sh | 2 +- 3 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 packages/ignitor/build.json create mode 100644 packages/ignitor/build.plugin.js diff --git a/packages/ignitor/build.json b/packages/ignitor/build.json new file mode 100644 index 000000000..d8349e4d4 --- /dev/null +++ b/packages/ignitor/build.json @@ -0,0 +1,43 @@ +{ + "entry": { + "editor-preset-vision": "../editor-preset-vision/src/index.ts", + "react-simulator-renderer": "../react-simulator-renderer/src/index.ts", + "rax-simulator-renderer": "../rax-simulator-renderer/src/index.ts" + }, + "vendor": false, + "devServer": { + "hot": false + }, + "publicPath": "/", + "externals": { + "react": "var window.React", + "react-dom": "var window.ReactDOM", + "prop-types": "var window.PropTypes", + "@alifd/next": "var window.Next", + "@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" + }, + "plugins": [ + [ + "build-plugin-react-app" + ], + [ + "build-plugin-fusion", + { + "themePackage": "@alife/theme-lowcode-light" + } + ], + [ + "build-plugin-moment-locales", + { + "locales": [ + "zh-cn" + ] + } + ], + "./build.plugin.js" + ] +} diff --git a/packages/ignitor/build.plugin.js b/packages/ignitor/build.plugin.js new file mode 100644 index 000000000..c4255c125 --- /dev/null +++ b/packages/ignitor/build.plugin.js @@ -0,0 +1,16 @@ +const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin'); + +module.exports = ({ context, onGetWebpackConfig }) => { + onGetWebpackConfig((config) => { + config.resolve.plugin('tsconfigpaths').use(TsconfigPathsPlugin, [ + { + configFile: './tsconfig.json', + }, + ]); + config.plugins.delete('hot'); + config.devServer.hot(false); + if (context.command === 'start') { + config.devtool('inline-source-map'); + } + }); +}; diff --git a/scripts/start.sh b/scripts/start.sh index 0f80c7fcf..6834dc5e8 100755 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -4,4 +4,4 @@ lerna exec --scope @ali/lowcode-datasource-engine -- npm run build lerna exec --scope @ali/lowcode-rax-renderer -- npm run build lerna exec --scope @ali/lowcode-react-renderer -- npm run build -# lerna exec --scope @ali/lowcode-demo -- npm start +lerna exec --scope @ali/lowcode-ignitor -- npm start