wp-blank-scripts 4.0.0-dev-12 → 4.0.0-dev-13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/utils/isReactProject.js +3 -0
package/package.json
CHANGED
package/utils/isReactProject.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
const fs = require('fs');
|
|
2
2
|
|
|
3
3
|
const getProjectPath = require('./getProjectPath');
|
|
4
|
+
const bypassReactCheck = process.env.REACT || false;
|
|
4
5
|
|
|
5
6
|
// Cache the value
|
|
6
7
|
let _isReactProject;
|
|
7
8
|
|
|
8
9
|
// Check for react in the project deps, if it's there treat this project as headless
|
|
9
10
|
function isReactProject() {
|
|
11
|
+
// Some non-headless projects want to use 'react' so let them. Pass REACT=true in package.json
|
|
12
|
+
if(bypassReactCheck) return false;
|
|
10
13
|
if (typeof _isReactProject === 'undefined') {
|
|
11
14
|
const projectPckPath = getProjectPath('package.json');
|
|
12
15
|
const pckFile = fs.readFileSync(projectPckPath);
|