helpers / handlebars-helpers

188 handlebars helpers in ~20 categories. Can be used with Assemble, Ghost, YUI, express.js etc.
http://assemble.io/helpers/
MIT License
2.22k stars 364 forks source link

`Invalid left-hand side in assignment` when packing Hanlebar-helpers with ncc #375

Open rfennell opened 3 years ago

rfennell commented 3 years ago

Thank you for this project, I am successfully using it in a Typscript/Node project, loading it as follows

const handlebars = require('handlebars')

const helpers = require('handlebars-helpers')({
    handlebars: handlebars
})

However I have found a problem if I try to package my project using @vercel/ncc to produce as single index.js. The command I am using the command

ncc build --source-map --license licenses.txt

The single index.js is create and all the code up to loading the handlebar-helpers module works, but the loading of the module causes the error

Invalid left-hand side in assignment

Note: this error only occurs if I package using ncc, if I use the uncompressed files my projects works as expected.

On searching for this issue I can see it usually related to a old versions of referenced module in a module see this issue in the vercel/ncc repo.

I wonder if you hade seen this before, and if there was any potential solution?