|
|
const shelljs = require('shelljs');
|
|
|
const path = require('path');
|
|
|
const pkg = require('../package.json');
|
|
|
|
|
|
const distDir = path.join(__dirname, '../dist/node');
|
|
|
|
...
|
...
|
@@ -20,8 +19,8 @@ const cpPaths = [ |
|
|
'doraemon',
|
|
|
'utils',
|
|
|
'apps/index.html',
|
|
|
`dist/yoho-ssr-client-${pkg.version}.json`,
|
|
|
`dist/yoho-ssr-server-${pkg.version}.json`
|
|
|
'dist/manifest.json',
|
|
|
'dist/manifest.server.json'
|
|
|
];
|
|
|
|
|
|
new Promise(resolve => { // 加载manifest.json文件
|
...
|
...
|
@@ -42,12 +41,12 @@ new Promise(resolve => { // 加载manifest.json文件 |
|
|
shelljs.cp('-R', path.join(__dirname, '../', file), dist);
|
|
|
});
|
|
|
}).then(() => { // 验证文件正确性
|
|
|
if (!shelljs.test('-e', path.join(distDir, `yoho-ssr-client-${pkg.version}.json`))) {
|
|
|
console.error('error:check yoho-ssr-client.json faild');
|
|
|
if (!shelljs.test('-e', path.join(distDir, 'manifest.json'))) {
|
|
|
console.error('error:check manifest.json faild');
|
|
|
return process.exit(1); //eslint-disable-line
|
|
|
}
|
|
|
if (!shelljs.test('-e', path.join(distDir, `yoho-ssr-server-${pkg.version}.json`))) {
|
|
|
console.error('error:check yoho-ssr-server.json faild');
|
|
|
if (!shelljs.test('-e', path.join(distDir, 'manifest.server.json'))) {
|
|
|
console.error('error:check manifest.server.json faild');
|
|
|
return process.exit(1); //eslint-disable-line
|
|
|
}
|
|
|
}).then(() => { // 安装依赖和清理node_modules
|
...
|
...
|
|