Re:Adding JavaScript modules to the web platform
by domenicd on Wednesday April 13, 2016 @04:31PM
(#11491938)
You can also do
or maybe better, set up your server-side rewrite rules so that instead of that you do
[ Parent
| on HN ]
Re:Adding JavaScript modules to the web platform
by spankalee on Wednesday April 13, 2016 @05:05PM
(#11492204)
I'm not sure how a reusable module that depends on jquery could make these assumptions about where the server-wide JS directory is.
../package-name/ works with multiple apps on the same server, and mounted in other places than root. It's working quite well for us with HTML imports.
Re:Adding JavaScript modules to the web platform
by clord on Wednesday April 13, 2016 @08:38PM
(#11493523)
I'd rather have each module have its own dependencies as subdirectories, sort of like node_modules. Everyone resolves paths from cwd.
If someone wants to share the same jquery across subdirs, I'm sure http redirects could be configured. Or alternately some sort of corporate versioning convention that developers can expect to have with absolute paths. Certainly better than ../jquery.