wzrd.in icon indicating copy to clipboard operation
wzrd.in copied to clipboard

Way to enforce the standalone package name

Open thom4parisot opened this issue 11 years ago • 3 comments

If a module is named like peaks.js, where the . has a decorative value and not a namespace value, /standalone/peaks.js is equivalent to the --standalone peaks.js browserify command.

The issue is the exported module is exported as window.peaks.js, js becoming a property of the namespace peaks.

It does not seem to be doable in substack/node-browserify#818: what could be a proper way to define the standalone module name for browserify-cdn?

I would definitely map /standalone/peaks.js as --standalone peaks, to match the library examples and so on.

Thanks for your insights :-)

thom4parisot avatar Jul 11 '14 09:07 thom4parisot

Probably I would just s/./_/ or similar, and then document it.

jfhbrook avatar Jul 11 '14 13:07 jfhbrook

The same for modules with a - in the name. f.e. 1-liners would become window.1-liners but this breaks before it even builds. see https://wzrd.in/standalone/[email protected] or https://wzrd.in/standalone/2dgeometry@latest (a module starting with a number is also not valid.)

refs 1-liners/1-liners/issues/128

stoeffel avatar Jul 22 '15 14:07 stoeffel

I think the best solution would be to add a possibility for defining the standalone-variable f.e. https://wzrd.in/standalone/oneLiners/1-liners@latest

stoeffel avatar Jul 22 '15 18:07 stoeffel