egeriis / zipcelx

Turns JSON data into `.xlsx` files in the browser
MIT License
293 stars 90 forks source link

Add back CommonJS build #56

Closed egeriis closed 5 years ago

egeriis commented 5 years ago

Resolves #43, #41, #24, #23

rohitrishi commented 5 years ago

Hello, Not sure if this is the best place to mention this but I just npm installed this module and the folder that gets installed in node_modules does not contain the legacy.js file.

This is causing issues in our mocha testing framework. We are running our tests like so: mocha test.js --require @babel\regiter --require setupTestInfra.js

I tried the "ignore": [/node_modules\/1rohit(?!\/index.js)/] option in the .babelrc.js file to try and get @babel\register to transpile only this module in the node_modules folder but that did not fix it. The file is read as es6 when we run our tests and it results in an "Unexpected token" error for the export keyword.

If I pull down the code for this repo and run the build locally then the legacy.js file does get generated. After copy pasting that into the node_modules/zipcelx/lib folder and referencing it like so: import zipcelx from 'zipcelx/lib/legacy everything works as expected in the tests.