Skip to content

[Bug]: extensionAlias is undefined when use webpack provider #3548

@beliefgp

Description

@beliefgp

Version

System:
    OS: macOS 14.5
    CPU: (8) arm64 Apple M3
    Memory: 87.39 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Browsers:
    Chrome: 129.0.6668.70
    Safari: 17.5
  npmPackages:
    @rsbuild/core: ^1.0.1 => 1.0.6 
    @rsbuild/plugin-less: ^1.0.1 => 1.0.1 
    @rsbuild/plugin-vue: ^1.0.1 => 1.0.1 
    @rsbuild/plugin-webpack-swc: ^1.0.2 => 1.0.2 
    @rsbuild/webpack: ^1.0.5 => 1.0.5

Details

https://github.com/web-infra-dev/rsbuild/blob/main/packages/core/src/plugins/resolve.ts#L48

extensionAlias is undefined when use webpack provider,

use rspack, it is ok

import { defineConfig } from '@rsbuild/core';
import { pluginVue } from '@rsbuild/plugin-vue';
import { webpackProvider } from '@rsbuild/webpack';
import { pluginSwc } from '@rsbuild/plugin-webpack-swc';

export default defineConfig({
  provider: webpackProvider,
  source: {
    entry: {
      main: './src/index.ts'
    },
  },
  plugins: [
    pluginSwc(),
    pluginVue(), 
  ]
});

plugin-webpack has its own rsbuild dependency, should it be changed to peer?

https://github.com/web-infra-dev/rsbuild/blob/main/packages/compat/webpack/package.json#L31

Reproduce link

xxx

Reproduce Steps

npx rsbuild build

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions