Skip to content

[Bug]: less file yields ModuleParseError with @ import #476

Open
@Yexiaoxing

Description

Version

System:
    OS: macOS 14.6.1
    CPU: (10) arm64 Apple M2 Pro
    Memory: 78.92 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Browsers:
    Edge: 127.0.2651.105
    Safari: 17.6
  npmPackages:
    @rsdoctor/webpack-plugin: ^0.3.11 => 0.3.11

Details

When there is a less file and MiniCssExtractPlugin + less-loader configured, the error will show:

ERROR in ../styles/page.less
Module build failed (from ../node_modules/@rsdoctor/core/dist/inner-plugins/loaders/proxy.js):
ModuleParseError: Module parse failed: Unexpected character '@' (1:0)
File was processed with these loaders:
 * ../node_modules/@rsdoctor/core/dist/inner-plugins/loaders/proxy.js
 * ../node_modules/@rsdoctor/core/dist/inner-plugins/loaders/proxy.js
You may need an additional loader to handle the result of these loaders.
> @import "../node_modules/normalize.css/normalize.css";

seems like the less-loader is not taking effect.

Reproduce link

https://stackblitz.com/edit/github-uloart

Reproduce Steps

npm run build

Metadata

Assignees

Labels

🐞 bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions