Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webpack deprecation warning #507

Open
socreative opened this issue Oct 23, 2023 · 0 comments
Open

Webpack deprecation warning #507

socreative opened this issue Oct 23, 2023 · 0 comments

Comments

@socreative
Copy link

socreative commented Oct 23, 2023

I am using Angular CLI to build the app and have svg-sprite-loader config in the custom webpack configuration file.

Here's the full stacktrace of the issue

.(node:28420) [DEP_WEBPACK_COMPILATION_NORMAL_MODULE_LOADER_HOOK] DeprecationWarning: Compilation.hooks.normalModuleLoader was moved to NormalModule.getCompilationHooks(compilation).loader
    at getNormalModuleLoader (C:\work\alphatax-cloud-developer-tools-ui\node_modules\@angular-devkit\build-angular\node_modules\webpack\lib\Compilation.js:436:39)
    at get normalModuleLoader [as normalModuleLoader] (C:\work\alphatax-cloud-developer-tools-ui\node_modules\@angular-devkit\build-angular\node_modules\webpack\lib\Compilation.js:870:12)
    at C:\work\alphatax-cloud-developer-tools-ui\node_modules\svg-sprite-loader\lib\plugin.js:79:16
    at Hook.eval [as call] (eval at create (C:\work\alphatax-cloud-developer-tools-ui\node_modules\tapable\lib\HookCodeFactory.js:19:10), <anonymous>:28:1)
    at Hook.CALL_DELEGATE [as _call] (C:\work\alphatax-cloud-developer-tools-ui\node_modules\tapable\lib\Hook.js:14:14)
    at Compiler.newCompilation (C:\work\alphatax-cloud-developer-tools-ui\node_modules\@angular-devkit\build-angular\node_modules\webpack\lib\Compiler.js:1121:30)
    at C:\work\alphatax-cloud-developer-tools-ui\node_modules\@angular-devkit\build-angular\node_modules\webpack\lib\Compiler.js:1166:29
    at eval (eval at create (C:\work\alphatax-cloud-developer-tools-ui\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:20:1)

My custom webpack config is this:

const path = require('path');
const SpritePlugin = require('svg-sprite-loader/plugin');

module.exports = {
  resolve: {
    fallback: {
      module: false,
      process: false
    }
  },
  module: {
    rules: [
      {
        test: /\.(svg)$/,
        use: [
          {
            loader: 'svg-sprite-loader',
            options: {
              extract: true,
              outputPath: 'assets/svg-sprites/',
              spriteFilename: svgPath => {
                return svgPath.includes('a-icons') ? '1-sprite.svg' : '2-sprite.svg'
              }
            }
          },
        ],
        include: [
          path.join(__dirname, 'projects/ui/src/assets/icons'),
        ],
      },
    ],
  },

  plugins: [
    new SpritePlugin()
  ]
}

Any idea why i see the deprecation warning?

The sprite loader version I am using is 6.0.11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant