chore: 整体构建
This commit is contained in:
parent
9ef299979c
commit
9fc1b065ce
25
build.json
25
build.json
|
|
@ -1,7 +1,28 @@
|
|||
{
|
||||
"entry": {
|
||||
"demo-general/preview": "./demo-general/src/preview.tsx",
|
||||
"demo-general/index": "./demo-general/src/preview.tsx"
|
||||
"demo-general/index" : "./demo-general/src/index.ts",
|
||||
"demo-general/preview" : "./demo-general/src/preview.tsx",
|
||||
|
||||
"demo-antd-pro-with-formily/index" : "./demo-antd-pro-with-formily/src/index.ts",
|
||||
"demo-antd-pro-with-formily/preview" : "./demo-antd-pro-with-formily/src/preview.tsx",
|
||||
|
||||
"demo-basic-antd/index" : "./demo-basic-antd/src/index.ts",
|
||||
"demo-basic-antd/preview" : "./demo-basic-antd/src/preview.tsx",
|
||||
|
||||
"demo-basic-fusion/index" : "./demo-basic-fusion/src/index.ts",
|
||||
"demo-basic-fusion/preview" : "./demo-basic-fusion/src/preview.tsx",
|
||||
|
||||
"demo-basic-fusion-with-single-component/index" : "./demo-basic-fusion-with-single-component/src/index.ts",
|
||||
"demo-basic-fusion-with-single-component/preview" : "./demo-basic-fusion-with-single-component/src/preview.tsx",
|
||||
|
||||
"demo-custom-initialization/index" : "./demo-custom-initialization/src/index.tsx",
|
||||
"demo-custom-initialization/preview" : "./demo-custom-initialization/src/preview.tsx",
|
||||
|
||||
"demo-next-pro/index" : "./demo-next-pro/src/index.ts",
|
||||
"demo-next-pro/preview" : "./demo-next-pro/src/preview.tsx",
|
||||
|
||||
"demo-node-extended-actions/index" : "./demo-node-extended-actions/src/index.ts",
|
||||
"demo-node-extended-actions/preview" : "./demo-node-extended-actions/src/preview.tsx"
|
||||
},
|
||||
"vendor": false,
|
||||
"devServer": {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
const fs = require('fs-extra');
|
||||
const configuration = require('./build.json');
|
||||
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
|
||||
|
|
@ -17,31 +18,67 @@ module.exports = ({ onGetWebpackConfig }) => {
|
|||
fs: 'empty',
|
||||
},
|
||||
});
|
||||
const entries = Object.keys(configuration.entry) || [];
|
||||
entries.map((entry) => {
|
||||
const [scenarioName, page] = entry.split('/');
|
||||
if (page === 'index') {
|
||||
config
|
||||
.plugin(entry)
|
||||
.use(HtmlWebpackPlugin, [
|
||||
{
|
||||
inject: false,
|
||||
minify: false,
|
||||
templateParameters: {
|
||||
version,
|
||||
scenarioName
|
||||
},
|
||||
template: require.resolve('./public/index.ejs'),
|
||||
filename: `${scenarioName}/index.html`,
|
||||
},
|
||||
]);
|
||||
}
|
||||
if (page === 'preview') {
|
||||
config
|
||||
.plugin(entry)
|
||||
.use(HtmlWebpackPlugin, [
|
||||
{
|
||||
inject: false,
|
||||
minify: false,
|
||||
templateParameters: {
|
||||
scenarioName,
|
||||
},
|
||||
template: require.resolve('./public/preview.html'),
|
||||
filename: `${scenarioName}/preview.html`,
|
||||
},
|
||||
]);
|
||||
|
||||
config
|
||||
.plugin('demo-general/index')
|
||||
.use(HtmlWebpackPlugin, [
|
||||
{
|
||||
inject: false,
|
||||
minify: false,
|
||||
templateParameters: {
|
||||
version,
|
||||
},
|
||||
template: require.resolve('./demo-general/public/index.ejs'),
|
||||
filename: 'index.html',
|
||||
},
|
||||
]);
|
||||
config
|
||||
.plugin('demo-general/preview')
|
||||
.use(HtmlWebpackPlugin, [
|
||||
{
|
||||
inject: false,
|
||||
templateParameters: {
|
||||
},
|
||||
template: require.resolve('./demo-general/public/preview.html'),
|
||||
filename: 'preview.html',
|
||||
},
|
||||
]);
|
||||
}
|
||||
})
|
||||
|
||||
// config
|
||||
// .plugin('demo-general/index')
|
||||
// .use(HtmlWebpackPlugin, [
|
||||
// {
|
||||
// inject: false,
|
||||
// minify: false,
|
||||
// templateParameters: {
|
||||
// version,
|
||||
// },
|
||||
// template: require.resolve('./demo-general/public/index.ejs'),
|
||||
// filename: 'demo-general/index.html',
|
||||
// },
|
||||
// ]);
|
||||
// config
|
||||
// .plugin('demo-general/preview')
|
||||
// .use(HtmlWebpackPlugin, [
|
||||
// {
|
||||
// inject: false,
|
||||
// templateParameters: {
|
||||
// },
|
||||
// template: require.resolve('./demo-general/public/preview.html'),
|
||||
// filename: 'demo-general/preview.html',
|
||||
// },
|
||||
// ]);
|
||||
|
||||
config.plugins.delete('hot');
|
||||
config.devServer.hot(false);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"info": "Hello AliLowCode!!"
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"info": "Hello AliLowCode!!"
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"info": "Hello AliLowCode!!"
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"info": "Hello AliLowCode!!"
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"info": "Hello AliLowCode!!"
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"info": "Hello AliLowCode!!"
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"info": "Hello AliLowCode!!"
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"info": "Hello AliLowCode!!"
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.5 KiB |
|
|
@ -0,0 +1,48 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
|
||||
<title>阿里低代码引擎 Demo</title>
|
||||
<link rel="icon" href="//img.alicdn.com/imgextra/i2/O1CN01lNWGJi1xflgRfSgbk_!!6000000006471-55-tps-22-26.svg">
|
||||
<link href="/css/<%= scenarioName %>/index.css" rel="stylesheet" />
|
||||
<!-- 低代码引擎的页面主题样式,可以替换为 theme-lowcode-dark -->
|
||||
<link href="https://alifd.alicdn.com/npm/@alifd/theme-lowcode-light@0.2.1/variables.css" rel="stylesheet" />
|
||||
<link href="https://alifd.alicdn.com/npm/@alifd/theme-lowcode-light@0.2.1/dist/next.var.min.css" rel="stylesheet" />
|
||||
<!-- 低代码引擎的页面框架样式 -->
|
||||
<link rel="stylesheet" href="https://alifd.alicdn.com/npm/@alilc/lowcode-engine@1.0.14/dist/css/engine-core.css" />
|
||||
<!-- 低代码引擎官方扩展的样式 -->
|
||||
<link rel="stylesheet" href="https://alifd.alicdn.com/npm/@alilc/lowcode-engine-ext@1.0.4/dist/css/engine-ext.css" />
|
||||
|
||||
<!-- React,可替换为 production 包 -->
|
||||
<script src="https://g.alicdn.com/code/lib/react/16.13.1/umd/react.production.min.js"></script>
|
||||
<!-- React DOM,可替换为 production 包 -->
|
||||
<script src="https://g.alicdn.com/code/lib/react-dom/16.13.1/umd/react-dom.production.min.js"></script>
|
||||
<!-- React 向下兼容,预防物料层的依赖 -->
|
||||
<script src="https://g.alicdn.com/code/lib/prop-types/15.7.2/prop-types.js"></script>
|
||||
<script src="https://g.alicdn.com/platform/c/react15-polyfill/0.0.1/dist/index.js"></script>
|
||||
<!-- lodash,低代码编辑器的依赖 -->
|
||||
<script src="https://g.alicdn.com/platform/c/lodash/4.6.1/lodash.min.js"></script>
|
||||
<!-- 日期处理包,Fusion Next 的依赖 -->
|
||||
<script src="https://g.alicdn.com/mylib/moment/2.24.0/min/moment.min.js"></script>
|
||||
<!-- Fusion Next 的主包,低代码编辑器的依赖 -->
|
||||
<script src="https://g.alicdn.com/code/lib/alifd__next/1.23.24/next.min.js"></script>
|
||||
<!-- 低代码引擎的主包 -->
|
||||
<script crossorigin="anonymous" src="https://alifd.alicdn.com/npm/@alilc/lowcode-engine@1.0.14/dist/js/engine-core.js"></script>
|
||||
<!-- 低代码引擎官方扩展的主包 -->
|
||||
<script crossorigin="anonymous" src="https://alifd.alicdn.com/npm/@alilc/lowcode-engine-ext@1.0.4/dist/js/engine-ext.js"></script>
|
||||
<script>
|
||||
console.log(
|
||||
'%c AliLowCodeEngineDemo %c v<%= version %> ',
|
||||
'padding: 2px 1px; border-radius: 3px 0 0 3px; color: #fff; background: #b37feb; font-weight: bold;',
|
||||
'padding: 2px 1px; border-radius: 0 3px 3px 0; color: #fff; background: #42c02e; font-weight: bold;',
|
||||
);
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="lce-container"></div>
|
||||
<script type="text/javascript" src="/js/<%= scenarioName %>/index.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1 @@
|
|||
勿删,删了有奇妙的 bug😄~
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
||||
<title>阿里低代码引擎 Demo - 预览页</title>
|
||||
<link href="https://g.alicdn.com/code/lib/alifd__next/1.23.24/next.min.css" rel="stylesheet">
|
||||
<link href="/css/<%= scenarioName %>/preview.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<div id="ice-container"></div>
|
||||
<script>
|
||||
window.g_config = {
|
||||
locale: 'zh_CN',
|
||||
};
|
||||
</script>
|
||||
<script src="https://g.alicdn.com/code/lib/react/16.13.1/umd/react.production.min.js"></script>
|
||||
<script src="https://g.alicdn.com/code/lib/react-dom/16.13.1/umd/react-dom.production.min.js"></script>
|
||||
<script src="https://g.alicdn.com/code/lib/prop-types/15.7.2/prop-types.js"></script>
|
||||
<script src="https://g.alicdn.com/platform/c/??react15-polyfill/0.0.1/dist/index.js,lodash/4.6.1/lodash.min.js"></script>
|
||||
<script src="https://g.alicdn.com/mylib/moment/2.24.0/min/moment.min.js"></script>
|
||||
<script src="https://g.alicdn.com/code/lib/alifd__next/1.23.24/next.min.js"></script>
|
||||
<script type="text/javascript" src="/js/<%= scenarioName %>/preview.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in New Issue