he icon indicating copy to clipboard operation
he copied to clipboard

fix: add es module

Open sastan opened this issue 4 years ago • 1 comments

This PR adds an es module (he.esm.js). This is currently handcrafted by basically removing the UMD wrapper and adding the exports at the bottom of the file. This file is then references from package.json using the module field. This is in my opinion a non-breaking change.

I hope this can be published soon as it would allow he to be used by packages that are esm based and and bundlers that have difficulties to detect the exported names.

I'd like to have this automated but i could not get the grunt build to run:

Running "shell:process-data" (shell) task
/Users/sastan/Projects/os/he/node_modules/sort-object/index.js:71
                var k = get(sortBy, key)[j++];
                                        ^

TypeError: Cannot read property '0' of undefined
    at sort (..../he/node_modules/sort-object/index.js:71:27)
    at Object.<anonymous> (..../he/scripts/process-data.js:96:35)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:191:16)
    at bootstrap_node.js:612:3
Warning: Command failed: node scripts/process-data.js
..../he/node_modules/sort-object/index.js:71
                var k = get(sortBy, key)[j++];
                                        ^

Any hint about how to solve this and i would adjust the PR.

Related #76

sastan avatar Jan 09 '21 10:01 sastan

Any news regarding this change? My team is looking forward to seeing it

marcos-castrillo avatar Dec 22 '23 10:12 marcos-castrillo