Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# ignore typed css module
*.scss.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.content-wrapper {
background-color: #fff;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { contentWrapper } from './index.module.scss';

export default contentWrapper;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="@rslib/core/types" />
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import button from './button/index';

export { button };
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "@rslib/tsconfig/base",
"compilerOptions": {
"baseUrl": "./"
},
"include": ["src"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "css-modules-named-bundle-false-test",
"version": "1.0.0",
"private": true,
"type": "module"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { pluginSass } from '@rsbuild/plugin-sass';
import { pluginTypedCSSModules } from '@rsbuild/plugin-typed-css-modules';
import { defineConfig } from '@rslib/core';
import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper';

export default defineConfig({
lib: [
generateBundleEsmConfig({ bundle: false }),
generateBundleCjsConfig({ bundle: false }),
],
source: {
entry: {
index: ['../__fixtures__/basic/src/**'],
},
},
output: {
target: 'web',
cssModules: {
namedExport: true,
exportLocalsConvention: 'camelCaseOnly',
},
},
plugins: [
pluginSass({
sassLoaderOptions: {
additionalData: '$base-color: #c6538c;',
},
}),
pluginTypedCSSModules(),
],
});
6 changes: 6 additions & 0 deletions tests/integration/style/css-modules-named/bundle/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "css-modules-named-bundle-test",
"version": "1.0.0",
"private": true,
"type": "module"
}
28 changes: 28 additions & 0 deletions tests/integration/style/css-modules-named/bundle/rslib.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { pluginSass } from '@rsbuild/plugin-sass';
import { pluginTypedCSSModules } from '@rsbuild/plugin-typed-css-modules';
import { defineConfig } from '@rslib/core';
import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper';

export default defineConfig({
lib: [generateBundleEsmConfig(), generateBundleCjsConfig()],
source: {
entry: {
index: ['../__fixtures__/basic/src/index.ts'],
},
},
output: {
target: 'web',
cssModules: {
namedExport: true,
exportLocalsConvention: 'camelCaseOnly',
},
},
plugins: [
pluginSass({
sassLoaderOptions: {
additionalData: '$base-color: #c6538c;',
},
}),
pluginTypedCSSModules(),
],
});
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/// <reference types="@rsbuild/core/types" />
/// <reference types="@rslib/core/types" />
1 change: 1 addition & 0 deletions tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"@rsbuild/plugin-less": "^1.1.1",
"@rsbuild/plugin-react": "^1.1.1",
"@rsbuild/plugin-sass": "^1.2.2",
"@rsbuild/plugin-typed-css-modules": "^1.0.2",
"@rslib/core": "workspace:*",
"@rslib/tsconfig": "workspace:*",
"@types/fs-extra": "^11.0.4",
Expand Down
Loading