mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-04-24 05:05:53 +08:00
Plug'n'Play support (#5136)
* Adds the PnP plugin for Webpack to find dependencies when working under PnP * Adds configuration for jest * Adds an e2e test for when using PnP * Avoids cra from crashing at the engine check * Avoids cra from crashing when initializing react-scripts * Makes the ownPath portable * Fixes linting * Bumps to pnp-webpack-plugin@1.1.0, removes symlinks: false * Adds a --use-pnp option * Pin version
This commit is contained in:
6
packages/react-scripts/scripts/init.js
vendored
6
packages/react-scripts/scripts/init.js
vendored
@@ -81,9 +81,9 @@ module.exports = function(
|
||||
originalDirectory,
|
||||
template
|
||||
) {
|
||||
const ownPackageName = require(path.join(__dirname, '..', 'package.json'))
|
||||
.name;
|
||||
const ownPath = path.join(appPath, 'node_modules', ownPackageName);
|
||||
const ownPath = path.dirname(
|
||||
require.resolve(path.join(__dirname, '..', 'package.json'))
|
||||
);
|
||||
const appPackage = require(path.join(appPath, 'package.json'));
|
||||
const useYarn = fs.existsSync(path.join(appPath, 'yarn.lock'));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user