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

Make sure importing source files is possible #1331

Open
3 tasks
eltonmesquita opened this issue Jul 15, 2021 · 7 comments
Open
3 tasks

Make sure importing source files is possible #1331

eltonmesquita opened this issue Jul 15, 2021 · 7 comments

Comments

@eltonmesquita
Copy link
Collaborator

@eltonmesquita eltonmesquita commented Jul 15, 2021

We should make sure that it's possible to import individual source files directly from the node_modules so developers won't need to resort to custom builds which are very annoying to maintain and not very practical these days.

I think we should check/add support for at least:

  • Webpack
  • Rollup
  • Parcel

Have a look at #1307 for more context.

@warengonzaga
Copy link
Member

@warengonzaga warengonzaga commented Sep 3, 2021

How about starting with webpack @eltonmesquita?

@ramanjitsingh-hub
Copy link

@ramanjitsingh-hub ramanjitsingh-hub commented Sep 20, 2021

I am a newbie can you verify that this problem can be solved using this link https://webpack.js.org/guides/getting-started/
I have time to combine a pr please go through this as I definitely need guidance

@joeworkman
Copy link

@joeworkman joeworkman commented Sep 20, 2021

Have a look at esbuild as well... https://esbuild.github.io

@warengonzaga
Copy link
Member

@warengonzaga warengonzaga commented Sep 20, 2021

Have a look at esbuild as well... https://esbuild.github.io

This is promising I need to check this out first. Thanks for sharing @joeworkman.

@ramanjitsingh-hub
Copy link

@ramanjitsingh-hub ramanjitsingh-hub commented Sep 20, 2021

I can combine a pr if someone can guide me through it

@eltonmesquita
Copy link
Collaborator Author

@eltonmesquita eltonmesquita commented Sep 29, 2021

This might not need a PR. The main task is to verify if it's possible today and if any change is required on our side, then putting a PR together with the fix will be the way to go.

Just a reminder that it already works when importing the main files in the root of the project, we just need to be sure that importing the source files, in the source directory, work properly in these main bundlers.

@eltonmesquita
Copy link
Collaborator Author

@eltonmesquita eltonmesquita commented Jan 12, 2022

I've tried it out with webpack and css-loader and it worked just fine. It's just a bit weird to use as you have to point to the whole path for the file for it to work. Like this:

import "animate.css/source/attention_seekers/bounce.css";
import "animate.css/source/animate.css";

It's not very practical. I'm not sure if we can provide a better way to use it without using some js, which I'm open to. Maybe an index.js file exporting all the CSS files could work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
V5.0.0
To do
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants