stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

feat: Add .cjs support for extensions

Open bluelovers opened this issue 2 years ago • 3 comments

when support .mjs, then maybe should also support .cjs as extensions

bluelovers avatar Mar 12 '23 03:03 bluelovers

the reason mjs had to be handled differently, at least as far as I understand, is that they needed a custom script type. This as far as I see is just a different extension.

AUTOMATIC1111 avatar Mar 12 '23 05:03 AUTOMATIC1111

use .cjs extensions for avoid some people run .js as esm this is make sure it is cjs and when copy file without rename it to .js

bluelovers avatar Mar 12 '23 05:03 bluelovers

when support .mjs, then maybe should also support .cjs as extensions

cjs is not used by browsers, cjs is common js used by nodejs modules and webui does not support running scripts in nodejs. using actual cjs format (e.g. using require statements in scripts) would break webui.

vladmandic avatar Mar 12 '23 13:03 vladmandic