Fix localPluginsToCopy

This commit is contained in:
Alexandre Bodin 2019-10-15 18:33:27 +02:00
parent 866a612d41
commit 58f0706840
2 changed files with 11 additions and 8 deletions

View File

@ -105,13 +105,16 @@ async function createCacheDir(dir) {
fs.existsSync(path.resolve(getPkgPath(dep), 'admin', 'src', 'index.js'))
);
const localPluginsToCopy = fs
.readdirSync(path.join(dir, 'plugins'))
.filter(plugin =>
fs.existsSync(
path.resolve(dir, 'plugins', plugin, 'admin', 'src', 'index.js')
)
);
let localPluginsToCopy = [];
if (fs.existsSync(path.join(dir, 'plugins'))) {
localPluginsToCopy = fs
.readdirSync(path.join(dir, 'plugins'))
.filter(plugin =>
fs.existsSync(
path.resolve(dir, 'plugins', plugin, 'admin', 'src', 'index.js')
)
);
}
// TODO: add logic to avoid copying files if not necessary

View File

@ -26,7 +26,7 @@ module.exports = async function createQuickStartProject(scope) {
try {
await trackUsage({ event: 'willBuildAdmin', scope });
await execa('npm', ['run', 'build'], {
await execa('npm', ['run', 'build', '--', '--no-optimization'], {
stdio: 'inherit',
cwd: scope.rootPath,
env: {