ng-zorro-antd icon indicating copy to clipboard operation
ng-zorro-antd copied to clipboard

Remove Less `javascriptEnabled` Usage

Open itayod opened this issue 3 years ago • 3 comments

Environment

Environment Info
ng-zorro-antd 9.3.0
Browser any

Description

Currently the library's less files are depending on javascriptEnabled option in less-loader config, unfortunately due to security issues this feature was deprecated long ago...

I have seen that Angular still uses this flag in his default Webpack config for less but going forward I guess it is a good idea to remove as I am not sure how long it will keep being supported (it is no longer works with higher less-loader versions...).

Currently it is blocking me from creating custom themes, which really pull me back from using this awesome library, I will be glad if you could fix that soon...

itayod avatar Sep 24 '20 09:09 itayod

For now, we can't remove of it. https://github.com/angular/angular-cli/issues/10430

hsuanxyz avatar Sep 25 '20 09:09 hsuanxyz

@hsuanxyz any plans to do so in the future? as you can see in the issue you have linked for it says:

However, since this feature is deprecated upstream from us, it will still go away in a future version of Angular CLI when Less no longer supports it.

itayod avatar Sep 27 '20 08:09 itayod

This problem has been on for 4 years. It's about a high time to remove javascriptEnabled feature from sass styles:

▲ [WARNING] Deprecated inline execution of JavaScript has been enabled ("javascriptEnabled") [plugin angular-less]

    node_modules/ng-zorro-antd/style/color/bezierEasing.less:110:0:
      110 │ .bezierEasingMixin();
          ╵ ^

  JavaScript found within less stylesheets may be executed at build time. [https://lesscss.org/usage/#less-options]
  Support for "javascriptEnabled" may be removed from the Angular CLI starting with Angular v19.
  The plugin "angular-less" was triggered by this import

    angular:styles/global:styles:1:8:

micobarac avatar Apr 18 '24 06:04 micobarac