Skip to content

CSS not included in dist package #271

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

Closed
roderickhsiao opened this issue May 18, 2017 · 19 comments
Closed

CSS not included in dist package #271

roderickhsiao opened this issue May 18, 2017 · 19 comments

Comments

@roderickhsiao
Copy link

roderickhsiao commented May 18, 2017

The latest version no longer include assets folder in the package

tested at version 7.0.8

it moves to /dist folder now, not sure this is expected as the documentation still points us to the assets folder.

@benjycui
Copy link
Member

@paranoidjk
Copy link
Member

@nadeemja
Copy link

nadeemja commented Aug 2, 2017

Having the same problem. Not sure how the links above help. Am I supposed to download the file and put it somewhere in my codebase? (v8.3.0)

@paranoidjk
Copy link
Member

@nadeemja Sorry for the trouble. I have fixed it just now,please try [email protected].

@nadeemja
Copy link

nadeemja commented Aug 2, 2017

Hi @paranoidjk !

Thanks for the quick response. Very impressive.

Unfortunately it didn't work.

I ran yarn remove rc-slider and then yarn add rc-slider.

@paranoidjk
Copy link
Member

@nadeemja
Copy link

nadeemja commented Aug 2, 2017

@paranoidjk

I don't understand what you want me to do.

Do I need to handle the css file separately?

@paranoidjk
Copy link
Member

@nadeemja What's your problem?

My answer is for this issue, see the issue title: CSS not included in dist package #271, and i fixed it.

@nadeemja
Copy link

nadeemja commented Aug 2, 2017

Yes. My problem is that the css is not included when installing the package. There is not assets folder, not even in 8.3.1

@paranoidjk
Copy link
Member

@nadeemja If you require from npm, you sould load style manually, see https://github.com/react-component/slider/blob/master/examples/slider.js#L2

@nadeemja
Copy link

nadeemja commented Aug 2, 2017

Yes, I understand - but the file does not exist.

Do you mean to say that we must manually download the file?

@paranoidjk
Copy link
Member

@nadeemja I checked it, right now i only published css to npm, so you can do:

import 'rc-slider/assets/index.css';

do you need less? Please let me know if it is necessary.

@paranoidjk
Copy link
Member

@nadeemja I think users no need to import less, just use css, since you have to compile less to css eventually.

@paranoidjk
Copy link
Member

@nadeemja see usage doc in readme: https://github.com/react-component/slider#usage 😄

@nadeemja
Copy link

nadeemja commented Aug 2, 2017

@paranoidjk

Okay. Let me explain.

  1. I ran yarn add rc-slider.

  2. I open node_modules/rc-slider.

  3. There is no assets folder in node_modules/rc-slider.

  4. Therefore, import 'rc-slider/assets/index.css'; gives error unable to resolve module.

I do not need Less. I'm just saying that the .css file is missing. :)

@paranoidjk
Copy link
Member

@nadeemja What's your version of rc-slider?

You could see from https://unpkg.com/[email protected]/ , There do have assets folder.

PS. what is unpkg? see https://unpkg.com/#/

@nadeemja
Copy link

nadeemja commented Aug 2, 2017

I'm using 8.3.1.

Perhaps it's a problem with Yarn.

Have you tested with Yarn?
https://github.com/yarnpkg/yarn

@paranoidjk
Copy link
Member

@nadeemja Yarn won't change the package files.

@nadeemja
Copy link

nadeemja commented Aug 2, 2017

I know. But then why is the assets folder not installed into node_modules/rc-slider?

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

No branches or pull requests

4 participants