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

Resolving modules paths possible? #19

Open
pykong opened this issue Jan 28, 2018 · 1 comment
Open

Resolving modules paths possible? #19

pykong opened this issue Jan 28, 2018 · 1 comment

Comments

@pykong
Copy link

pykong commented Jan 28, 2018

@amol- First of all thanks so much for putting up this interesting project!

As you have also mentioned webassets in your presentation on EuroPython 2016.
https://www.slideshare.net/__amol__/pyconit7-dukpy-webassets-free-yourself-from-nodejs-chains

I wondered whether it would be possible to use dukpy to resolve paths of all css and js files in a node_modules folder.

Currently the necessary function require.resolve('module_name'); does not work.

We could then feed those paths directly into webassets' Bundle().
If we could simply catch and bundle all packages we have downloaded that way, it would alleviate the need to update our Bundle config every time we add dependencies. Or create an elaborate config in the first place.

Hence we would only need to run dukpy.install_jspackage('bootstrap) and it would be automagically made available in our web templates. Thereby we could indeed dismiss npm.

IMHO. This could be one of the hidden superpowers of dukpy. (Opposed to mere transpilations, because we can do this with webassets already.)

@amol-
Copy link
Owner

amol- commented Jun 3, 2022

I would be glad to accept a PR that implements what you are describing. In the end dukpy goals is to allow an alternative to nodejs for Python users. Just make sure it doesn't allow access outsidem of the modules path provided to the interpreter as it might be source of security issues.

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

No branches or pull requests

2 participants