New issue
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
[Bug]: transformImport did not import styles. #6245
Labels
Comments
TopGrd
changed the title
[Bug]: transformImport is not work
[Bug]: transformImport did not import styles.
Apr 15, 2024
the cause might be when i changed it to will transfer the issue to rspack for help tomorrow. |
webpack's implementation: // https://npmjs.com/glob-to-regexp
const glob2regexp = require('glob-to-regexp');
const globToRegexp = (glob) => {
if (!glob.includes("/")) {
glob = `**/${glob}`;
}
const baseRegexp = glob2regexp(glob, { globstar: true, extended: true });
const regexpSource = baseRegexp.source;
const regexp = new RegExp("^(\\./)?" + regexpSource.slice(1));
return regexp;
};
globToRegexp('**/*/style.js').test('esm/input/style.js'); // true
// the regexp is /^(\.\/)?((?:[^/]*(?:\/|$))*)([^/]*)\/style\.js$/ while glob-match: |
xc2
added
bug
Something isn't working
pr welcome
and removed
pending triage
The issue/PR is currently untouched.
labels
Apr 16, 2024
This was referenced Apr 23, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version
Details
rsbuild.config.ts
I used transformImport to configure modular import, but the styles were not imported on demand. As you can see, the input box below lacks styling.
Reproduce link
https://github.com/TopGrd/rsbuild-transformImport
Reproduce Steps
The text was updated successfully, but these errors were encountered: