-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
require.resolve #5764
Comments
Simply put, the code base is monolithic − source files are separated the same way the Web used to parse them: <script src="parse.js"></script>
<script src="compress.js"></script>
<script src="minify.js"></script>
<!-- etc. --> Conversion to a modular approach would incur a lot of work, both in development hours and more importantly The preferred way of inclusion (which I guess many third party dependents of $ bin/uglifyjs --self [--mangle --compress] --output path/to/deploy/uglify.js since the result would be free of |
Not sure I follow (every other package manages just fine with Would it be feasible to distribute an official build via npm? This will hopefully make it easier for consuming libs to adopt making it simpler for end users to build their code as they please. |
AFAICT this project started off before Just importing (& maintaining) all the But your suggestion to distribute (& in fact, run) the packaged version on Alternatively, I can stick it to the end of my TODO list and may eventually get around to take a look at it. |
That would explain it, thanks!
I'd give it a try. Do you think just the built version should be distributed, or both built and unbuilt code should be included? edit: the benefit of including just the built version would mean that all consuming lib's would use this version by default when they next update their deps. This can also be achieved by pointing package.json's |
Yes, I think if we put the packaged file as If we want to maximise compatibility we can also include the existing
|
Is there a quick way (a la |
nm, I think I got it - see linked PR |
I think I'm running into this issue. We are using serverless to deploy a Lambda function that uses mjml for email templates. mjml imports uglify-js as a production dependency, but esbuild cannot follow require.resolves so it blows up. |
Ran into the same issue as @mattcasey exception with https://jsx.email. It uses rehype-minify, which uses uglify. Uglify doesn't play well with lambdas. |
+1 |
This project relies heavily on
require.resolve
. While this was initially introduced for better webpack support, this causes issue with other bundlers that don't supportrequire.resolve
such as esbuild.I was unable to determine why the project was initially set up this way. Is there any history that can be pointed to? Understanding the use case can be helpful in figuring out a way forward for wider bundler support.
Thanks!
The text was updated successfully, but these errors were encountered: