less / less.js

Less. The dynamic stylesheet language.
http://lesscss.org
Apache License 2.0
17.02k stars 3.41k forks source link

postCSS unable to set javascriptEnabled to true and import Antd #3556

Closed asherccohen closed 4 years ago

asherccohen commented 4 years ago

I am using a PostCSS configuration in rollup.config.js to modify less options with version: "3.11.1"

postcss({
        inject: true,
        extract: true,
        autoModules: true,
        plugins: [autoprefixer],
          extensions: ['.less'],
        use: [
          [
            'less',
            {
              javascriptEnabled: true,
               modifyVars: {
                'primary-color': '#1DA57A',
                'link-color': '#1DA57A',
                'border-radius-base': '2px',
              },
            },
          ],
        ],
      })

Apparently the loader does not allow setting javascriptEnabled to true.

Error during bundle: SyntaxError: Inline JavaScript is not enabled. Is it set in your options? in node_modules/antd/lib/style/color/bezierEasing.less on line 110, column 1:
109 // https://github.com/ant-design/ant-motion/issues/44
110 .bezierEasingMixin();
111
matthew-dean commented 4 years ago

This should be posted to the project for that postcss plugin.