fix(optimize-deps): don't externalize JS files imported with asset extensions#16242
Conversation
|
|
sapphi-red
left a comment
There was a problem hiding this comment.
Thanks. Would you add a test case in playground/optimize-deps?
sure, I'll add a test case |
|
@sapphi-red hi, I have submitted the test code, but how does the Actions check failing |
|
I guess you forgot to run |
| if (kind === 'require-call') { | ||
| // #16116 fix: Import the module.scss path, which is actually module.scss.js | ||
| if (resolved.endsWith('.js')) { |
There was a problem hiding this comment.
Is there a reason we only check this in require-call only? Wouldn't this help for imports too?
There was a problem hiding this comment.
I think the reason is because we don't support import without extensions in dependencies. But I've noticed that there's a case like import 'normalize.css'.
There was a problem hiding this comment.
Ah right, you have to specify the full path with imports. Let's try this then.
Description
fix #16116 importing a CommonJS module installed from NPM. The modue contains files with filenames like PeoplePicker.scss.js. These are JavaScript files, obviously, but the filename contains scss.
What is the purpose of this pull request?