Skip to content

Commit

Permalink
Skip react-scripts preflight checks for upstreams deps.
Browse files Browse the repository at this point in the history
  • Loading branch information
timdorr committed Jan 27, 2019
1 parent d32f9fa commit afe00b0
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions examples/testAll.js
Expand Up @@ -7,15 +7,12 @@ const path = require('path')
const { spawnSync } = require('child_process')
const chalk = require('chalk')

const exampleDirs = fs.readdirSync(__dirname).filter((file) => {
const exampleDirs = fs.readdirSync(__dirname).filter(file => {
return fs.statSync(path.join(__dirname, file)).isDirectory()
})

// Ordering is important here. `npm install` must come first.
const cmdArgs = [
{ cmd: 'npm', args: [ 'ci' ] },
{ cmd: 'npm', args: [ 'test' ] }
]
const cmdArgs = [{ cmd: 'npm', args: ['ci'] }, { cmd: 'npm', args: ['test'] }]

for (const dir of exampleDirs) {
if (dir === 'counter-vanilla' || dir === 'universal') continue
Expand All @@ -25,7 +22,8 @@ for (const dir of exampleDirs) {
// declare opts in this scope to avoid https://github.com/joyent/node/issues/9158
const opts = {
cwd: path.join(__dirname, dir),
stdio: 'inherit'
stdio: 'inherit',
env: { ...process.env, SKIP_PREFLIGHT_CHECK: 'true' }
}

let result = {}
Expand All @@ -35,7 +33,7 @@ for (const dir of exampleDirs) {
result = spawnSync(cmdArg.cmd, cmdArg.args, opts)
}
if (result.status !== 0) {
console.log(result);
console.log(result)
throw new Error('Building examples exited with non-zero')
}
}
Expand Down

0 comments on commit afe00b0

Please sign in to comment.