-
Notifications
You must be signed in to change notification settings - Fork 1
/
ejsRender.config.js
35 lines (31 loc) · 1.48 KB
/
ejsRender.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
const path = require('path');
const ROOT = path.join(__dirname, './');
const ejsData = {
targets: ['web'],
miniappType: 'runtime',
mpa: false,
pha: false,
};
const previewData = [
{ name: 'Web', message: '建议使用手机浏览器扫码', output: 'web/index.html' },
// { name: 'Weex', message: '建议使用手机淘宝扫码', output: 'weex/index.js' },
];
// Add preview to ejs scaffolds template.
// Build or dev scaffolds project you should see blew config first.
module.exports = {
tmpDir: path.join(ROOT, 'scaffoldsTemps'),
scaffolds: [
// For example: { name: 'app-js-base', target: path.join(ROOT, 'scaffolds/app-js/'), data: {targets: ['web']} }
// Will pass EJS target('scaffolds/app-js') template and the config data got 'scaffoldsTempDir/app-js-base' result
{
target: path.join(ROOT, 'scaffolds/app-js/'), // target template path
name: 'app-js', // temp dir name
data: ejsData, // ejs render data
preview: previewData, // preview url for qrcode
},
{ target: path.join(ROOT, 'scaffolds/app-ts/'), name: 'app-ts', data: ejsData, preview: previewData },
{ target: path.join(ROOT, 'scaffolds/app-midway-faas/'), name: 'app-midway-faas', data: ejsData, preview: previewData },
{ target: path.join(ROOT, 'scaffolds/app-midway-faas/'), name: 'app-midway-ssr', data: ejsData, preview: previewData },
{ target: path.join(ROOT, 'scaffolds/app-midway-miniapp/'), name: 'app-midway-miniapp', data: ejsData, preview: previewData },
],
};