fix(cli): yarn install --production error
This commit is contained in:
parent
5156cda89f
commit
8298d2a691
@ -1,4 +1,5 @@
|
||||
const { Command } = require('commander');
|
||||
const { isPackageValid } = require('../util');
|
||||
|
||||
/**
|
||||
*
|
||||
@ -15,5 +16,7 @@ module.exports = (cli) => {
|
||||
require('./umi')(cli);
|
||||
require('./upgrade')(cli);
|
||||
require('./postinstall')(cli);
|
||||
require('./create-plugin')(cli);
|
||||
if (isPackageValid('@umijs/utils')) {
|
||||
require('./create-plugin')(cli);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
const { Command } = require('commander');
|
||||
const { run, isDev } = require('../util');
|
||||
const { run, isDev, isPackageValid } = require('../util');
|
||||
const { resolve } = require('path');
|
||||
const { existsSync } = require('fs');
|
||||
const { readFile, writeFile } = require('fs').promises;
|
||||
@ -21,6 +21,9 @@ module.exports = (cli) => {
|
||||
const content = await readFile(resolve(cwd, '.env.example'), 'utf-8');
|
||||
await writeFile(resolve(cwd, '.env'), content, 'utf-8');
|
||||
}
|
||||
if (!isPackageValid('umi')) {
|
||||
return;
|
||||
}
|
||||
run('umi', ['generate', 'tmp'], {
|
||||
stdio: 'pipe',
|
||||
env: {
|
||||
|
Loading…
Reference in New Issue
Block a user