dougmoscrop / serverless-plugin-include-dependencies

MIT License
184 stars 38 forks source link

Enable es6.mixedImports #91

Open dev101 opened 9 months ago

dev101 commented 9 months ago

Any chance to add es6.mixedImports option in the precinct.paperwork call?

I have to use some ES modules via dynamic imports like const aModule = (await import('aModule')).default , and these are not detected by the default precinct config, thus not included in the package.

Also to make it work, it's essential to upgrade precint to some later version, as this es6 stuff doesn't work in precinct@8 (es modules are catched, but their dependencies missing).

dougmoscrop commented 9 months ago

yeah seems reasonable.. though to be honest, I don't know why people don't just use esbuild at this point.

dev101 commented 9 months ago

@dougmoscrop you mean https://github.com/floydspace/serverless-esbuild ? never heard of it until today.

serverless-plugin-include-dependencies worked just fine for me as I primarily maintain legacy cjs code, until some day some dependencies are only available as es modules.

nevertheless, on your side it's just about adding an option to paperwork and upgrading precint, seems to be backward-compatible and no breaking changes, huh?