-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove src to lib rewrites on package.json files #9612
Remove src to lib rewrites on package.json files #9612
Conversation
This commit modifies the strategy to local src/lib rewrites, so that the package.json files are never modified. Intead, the package.json files always point at `bin/...`; which in turn requires `lib/bin.js`. During development, `lib/bin.js` can just require `src/bin.js` and rely on require.extensions register. But on distribution `lib/**` can be pre-built. By maintaining a stable `bin/...` entry-point, the following benefits are achieved: * The git workspace does not become dirty after a build * It's not possible to get into a state where `node_modules/.bin/parcel` points at a non existant `lib/` file, which can only be fixed by removing node_modules and yarn installing again
e17b1ab
to
4d14f16
Compare
@yamadapc Is my understanding correct that to use Parcel via parcel link you'll now need to run |
That's right. We could add a postinstall hook or such that runs But IMO this is better because before you also would get corrupted workspaces on builds linked or otherwise. I have a feeling at the moment that you can run I'm running benchmarks in https://github.com/parcel-bundler/parcel-benchmark-action with prod. builds and in the current setup the workspace gets corrupted every time I build. So this change would help; there also is no way to commit the dirty files. The specific workflow for parcel-link might change very slightly; but it should be alright. |
This reverts commit 0eaf926. Restore the ability to build parcel on windows.
This commit modifies the strategy to local src/lib rewrites, so that the package.json files are never modified.
Intead, the package.json files always point at
bin/...
; which in turn requireslib/bin.js
.During development,
lib/bin.js
can just requiresrc/bin.js
and rely on require.extensions register. But on distributionlib/**
can be pre-built.By maintaining a stable
bin/...
entry-point, the following benefits are achieved:node_modules/.bin/parcel
points at a non existantlib/
file, which can only be fixed by removing node_modules and yarn installing again✔️ PR Todo