Skip to content
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

CSS not exported from package #35

Closed
totallyspun opened this issue Jun 30, 2021 · 4 comments
Closed

CSS not exported from package #35

totallyspun opened this issue Jun 30, 2021 · 4 comments
Assignees
Labels
bug Something isn't working as expected

Comments

@totallyspun
Copy link

totallyspun commented Jun 30, 2021

Hi,
I am trying to use shareon within a Webpack project, but I cannot import the styles, I get an error:

Package path ./dist/shareon.min.css is not exported from package /project/node_modules/shareon (see exports field in /project/node_modules/shareon/package.json)

My workaround is to import the styles from cdn, but I am wondering if the package exports can be updated in a future revision.

Thanks!

@kytta
Copy link
Owner

kytta commented Jun 30, 2021

Hey Paul,

yeah, I haven't tested the CSS imports in non-browser environments...

I am currently working on a version 2.0 of share on, where I will introduce some breaking changes but, through this, improve the imports and exports. I will also try to fix this issue in v1.x until weekend, but I can't promise I can implement this without breaking anything 😅 I'll keep you updated

@kytta kytta added the bug Something isn't working as expected label Jun 30, 2021
@kytta kytta self-assigned this Jun 30, 2021
@kytta
Copy link
Owner

kytta commented Feb 11, 2022

Hey Paul @totallyspun,

I am terribly sorry for taking so long! I am currently preparing the new Shareon release, v2.0.0. I have upgraded the way Shareon works and also moved the repository to a different source code hosting: Codeberg. This repo, however, will stay as a mirror.

I have now published a beta version: shareon@2.0.0-beta.3. I think I figured the CSS exports out. Could you please try it?

You now import Shareon's JS like this:

import { init } from "shareon";

init(); // will initialize the buttons

or this:

const Shareon = require("shareon");

Shareon.init(); // will initialize the buttons

CSS exports would then work like this:

import "shareon/css";

or this:

require("shareon/css");

Could you test it and tell me, if this works in your setup? I have sadly no experience with such CSS imports, so I can't really test it.

@kytta
Copy link
Owner

kytta commented Feb 13, 2022

Hi again Paul,

I've tested it on a simple Vite-built website, and it seems to actually work! I have now released the v2; you don't need to use the beta version any more. If you still experience problems, don't hesitate to open a new issue or contact me personally 😄

@kytta kytta closed this as completed Feb 13, 2022
@totallyspun
Copy link
Author

totallyspun commented Feb 25, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

2 participants