yoriiis / svg-chunk-webpack-plugin

Generate SVG sprites according to entrypoint dependencies. Each page only imports its own svgs, wrapped as a sprite and optimized by SVGO
https://webpack.js.org/plugins/svg-chunk-webpack-plugin
MIT License
19 stars 2 forks source link

Support for NodeJS 22.x #30

Open yuri-moskvin opened 3 months ago

yuri-moskvin commented 3 months ago

If the feature solves a problem you have, specify it here.

Hey! Thanks for this tool. Unfortunately it doesn't work with Node 22 because of deprecated import assert syntax. Probably assert can just be replaced with with.

[webpack-cli] SyntaxError: Unexpected identifier 'assert' at compileSourceTextModule (node:internal/modules/esm/utils:337:16) at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:164:18) at callTranslator (node:internal/modules/esm/loader:439:14) at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:445:30)

Describe the proposed feature.

Now: import unTypedSchemaOptions from './schemas/plugin-options.json' assert { type: 'json' };

New syntax: import unTypedSchemaOptions from './schemas/plugin-options.json' with { type: 'json' };

Describe alternatives you've considered

No response

Additional context

No response

Importance

Would make my life easier

yoriiis commented 3 months ago

Hello @yuri-moskvin, thanks for the report!

Do you want to try to make the changes with a pull request?