We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
System: OS: macOS 13.5.2 CPU: (10) arm64 Apple M1 Pro Memory: 342.98 MB / 32.00 GB Shell: 5.9 - /bin/zsh Browsers: Chrome: 116.0.5845.187 Safari: 16.6 npmPackages: @modern-js/eslint-config: 2.33.1 => 2.33.1 @modern-js/module-tools: 2.33.1 => 2.33.1 @modern-js/tsconfig: 2.33.1 => 2.33.1
The compiled CSS module filename may be same as another files.
For example, we have two files:
Then we use autoModules to make index.css as a CSS module file.
autoModules
index.css
import { moduleTools, defineConfig } from '@modern-js/module-tools'; export default defineConfig({ plugins: [moduleTools()], buildConfig: { buildType: 'bundleless', style: { autoModules: /\.css$/, }, }, });
Run build command, the build will fail:
https://github.com/chenjiahan/modern-module-css-modules-name-issue
The text was updated successfully, but these errors were encountered:
Maybe you should change the filename.. Or What is the expected output?
Sorry, something went wrong.
The expect behavior is that index.ts and index.css can work together.
index.ts
We can rename the generated js file of index.css by adding a special suffix, so it will not conflict with index.ts.
I'll save the filename, and replace . with _, so index.css will be index_css.js. How about it
.
_
index_css.js
but index.module.css will be index_module_css.js, but now it is index_module.js
index.module.css
index_module_css.js
index_module.js
This looks good:
Maybe this is even more safer:
__index_css.js
$index_css.js
Successfully merging a pull request may close this issue.
Version
Details
The compiled CSS module filename may be same as another files.
For example, we have two files:
Then we use
autoModules
to makeindex.css
as a CSS module file.Run build command, the build will fail:
Reproduce link
https://github.com/chenjiahan/modern-module-css-modules-name-issue
Reproduce Steps
The text was updated successfully, but these errors were encountered: