Skip to content

When the type of css and less in the module is set to css, the css set in the component is invalidate #3766

Closed
@ty-concision

Description

@ty-concision

System Info

System Info:
System:
OS: macOS 13.4.1
CPU: (10) arm64 Apple M1 Pro
Memory: 32.00GB
Shell: 5.9 - /bin/zsh

Binaries:
Node: 14.20.1
pnpm: 7.9.0

Browsers:
Chrome: 114.0.5735.198(正式版本) (arm64)

npmPackages:
@rspack/cli: 0.2.6

Details

Here's a vue project, in which rrspack.config.js is configured as follows:
const { VueLoaderPlugin } = require("vue-loader");

/** @type {import('@rspack/cli').Configuration} */
const config = {
context: __dirname,
entry: {
main: "./src/main.js"
},
builtins: {
html: [
{
template: "./index.html"
}
]
},
devServer: {
historyApiFallback: true
},
devtool: false,
plugins: [new VueLoaderPlugin()],
module: {
rules: [
{
test: /.vue$/,
use: ["vue-loader"]
},
{
test: /.css$/,
use: ["postcss-loader"],
type: "css"
},
{
test: /.less$/,
use: ["less-loader"],
type: "css"
},
{
test: /.svg$/,
type: "asset/resource"
}
]
},
experiments: {
css: false,
},
};
module.exports = config;

Reproduce link

https://gitee.com/tuoy/rspack-vue-demo

Reproduce Steps

  1. install pnpm install
  2. run pnpm dev
  3. Observe that the text style is not working. We expect the text color to be red. We have set this style in src/app.vue, but it is not working

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions