Skip to content

Keep style.css in ES module #524

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

Merged
merged 1 commit into from
Sep 7, 2021
Merged

Keep style.css in ES module #524

merged 1 commit into from
Sep 7, 2021

Conversation

juba
Copy link
Contributor

@juba juba commented Aug 30, 2021

The src/style.css file is not kept in the distributed ES module. If I understand correctly, keeping it would allow to import it directly and keep it up to date when using Plot from a package manager.

The `src/style.css` file is not kept in the distributed ES module. Keeping it would allow to import it directly and keep it up to date when using Plot from a package manager.
Copy link
Contributor

@Fil Fil left a comment

Choose a reason for hiding this comment

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

Yes I think you're correct.

@mbostock
Copy link
Member

We can include this in the distribution, but you still won’t be able to import or require the style.css because it’s not part of the declared exports. I’m not really sure how to support this type of usage.

@juba
Copy link
Contributor Author

juba commented Aug 30, 2021

I'm using webpack, and with a css-loader it is possible to "import" a CSS file in a bundle. I'm doing it in another project with the Observable runtime inspector CSS, so I think it should work with Plot too.

@mbostock mbostock merged commit 151d4aa into observablehq:main Sep 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants