Skip to content
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

feat: dot-env plugin #4113

Closed
wants to merge 43 commits into from
Closed

feat: dot-env plugin #4113

wants to merge 43 commits into from

Conversation

info-arnav
Copy link

@info-arnav info-arnav commented Mar 14, 2024

This PR adds a plugin directory with a basic dot-env support plugin.

I am not sure on how to go about it further. But provides a basic program in the plugin directory.

#3747

@info-arnav info-arnav requested a review from a team as a code owner March 14, 2024 18:47
Copy link

linux-foundation-easycla bot commented Mar 14, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@alexander-akait
Copy link
Member

We need something like https://github.com/mrsteele/dotenv-webpack, just rewrite it on using cache (i.e. inputFileSystem) and more refactor

@info-arnav
Copy link
Author

I have made some changes, add the caching to internal file system and refactored everything a bit

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be a plugin, no need to modify webpack-cli code

@webpack-bot
Copy link

@info-arnav Thanks for your update.

I labeled the Pull Request so reviewers will review it again.

@alexander-akait Please review the new changes.

@info-arnav
Copy link
Author

#3759

@info-arnav
Copy link
Author

please ask more if you do not understand, the previous version was more correct

so, shall i rever it back to synchronous running and then make the changes suggested ?

@info-arnav
Copy link
Author

@alexander-akait I tried to make changes, but like if i am using async then the tests arent executing and even the environment hooks are failing. Shall i make the other chaneges u said and revert stuff to a synchronous manner ?

@info-arnav
Copy link
Author

@alexander-akait I have a asynchronous version as well, please let me know if i should upload that as well, if that is a major requirment.

package.json Outdated Show resolved Hide resolved
@info-arnav
Copy link
Author

@alexander-akait can you please guide me on where to get the types for the logger. For input file system the type can not be used as we are using readFileSync

@info-arnav
Copy link
Author

@alexander-akait can you please guide me on where to get the types for the logger. For input file system the type can not be used as we are using readFileSync

please let me know about the hook also, as using initialize will remove the compilation object. so compilation.errors.push and compilation.cache wont work

@info-arnav
Copy link
Author

@alexander-akait at line 58 I tried adding a

compiler.hooks.compilation.tap

inside the

compiler.hooks.initialize.tap

does that make sense ?

@info-arnav
Copy link
Author

Also do you think adding a readFile in the compilation hook and SyncReadFile in the initilize hook makes sense ? As in we check if the compilation object was passed as an argument, if it was we proceed in an asynchronous way, else synchronous

@alexander-akait at line 58 I tried adding a

compiler.hooks.compilation.tap

inside the

compiler.hooks.initialize.tap

does that make sense ?

@evenstensberg
Copy link
Member

open a fresh pr please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants