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

[Bug]: lessLoaderOptions.lessOptions.plugins is not supported. #3810

Open
Sang-Sang33 opened this issue Oct 24, 2024 · 0 comments
Open

[Bug]: lessLoaderOptions.lessOptions.plugins is not supported. #3810

Sang-Sang33 opened this issue Oct 24, 2024 · 0 comments
Assignees
Labels
🐞 bug Something isn't working

Comments

@Sang-Sang33
Copy link

Sang-Sang33 commented Oct 24, 2024

Version

System:
OS: win10
Browsers:
Chorme: 124
npmPackages:
"@rsbuild/core": "^1.0.16",
"@rsbuild/plugin-babel": "^1.0.2",
"@rsbuild/plugin-vue": "^1.0.2",
"@rsbuild/plugin-vue-jsx": "^1.0.1",

Details

rsbuild.config.ts

import { TestPlugin } from './test-plugin';
import { resolve } from 'path';
import { defineConfig, rspack } from '@rsbuild/core';
import { pluginLess } from '@rsbuild/plugin-less';
import { pluginVue } from '@rsbuild/plugin-vue';

export default defineConfig({
  plugins: [
    pluginLess({
      lessLoaderOptions: {
        lessOptions: {
          javascriptEnabled: true,
          plugins: [new TestPlugin()]
        },
        implementation: require.resolve('less')
      }
    }),
    pluginVue()
  ],
  html: {
    template: './index.html'
  },
  source: {
    entry: {
      index: './src/main.ts'
    },
  },
});

test-plugin.ts

export class TestPlugin {
  options?: any;

  constructor(someOptions?: any) {
    this.options = someOptions;
  }

  install(_less: any, manager: any) {
    console.log('manager: ', manager);
    console.log('_less: ', _less);
    console.log(this.options)
   // ....... some code
  }
}

Howerver, the plugin's install function has never been invoked when i run rsbuild build in the command line.

Reproduce link

Please see the details.

Reproduce Steps

Please see the details.

@Sang-Sang33 Sang-Sang33 added the 🐞 bug Something isn't working label Oct 24, 2024
@chenjiahan chenjiahan self-assigned this Oct 24, 2024
Sang-Sang33 added a commit to Sang-Sang33/rsbuild that referenced this issue Oct 24, 2024
@chenjiahan chenjiahan assigned Sang-Sang33 and unassigned chenjiahan Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants