Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

fix: adding .js extension to exported *.css.js file #4364

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/clr-core/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ export * from './mixins/css-helpers';
export * from './mixins/unique-id';
export * from './mixins/apply-mixins';
export * from './interfaces';
export { styles as baseStyles } from './base/base.element.css';
export { styles as baseStyles } from './base/base.element.css.js';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will fix the issue temporarily for Jest but once we pull Core components into clr-angular it will break again. We should update all the relative import paths in core to have .js at the end like this one. This is a fundamental issue with TypeScripts output not including the .js file extension. See discussion here microsoft/TypeScript#16577

You can see here lit-html and lit-element do the same thing to get around this issue.
https://github.com/Polymer/lit-element/blob/master/src/lit-element.ts#L18

This would make this a pretty large PR so we can merge this to fix the Jest issue now and I can open a new issue describing the steps to address the rest or we tackle this now in this PR. Either way is fine.