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

Use without build #178

Open
TriMoon opened this issue Jun 10, 2019 · 11 comments
Open

Use without build #178

TriMoon opened this issue Jun 10, 2019 · 11 comments

Comments

@TriMoon
Copy link

TriMoon commented Jun 10, 2019

Is your feature request related to a problem? Please describe.
I want to be able to use this whole without using a build system, from source.

Describe the solution you'd like
Able to import a single file as es6-module, that pulls-in all needed sub-files. WITHOUT the need to use a build system to create the final file that will be imported.
Eg.: Pull the repo, and include a sinle file from the source gotten.

Additional context
I see you guys using nodejs/rollup/etc but i want to use the raw sources directly as ES6-module(s).
For example which file is used by import { library } from '@fortawesome/fontawesome-svg-core' from the repo?

@robmadole
Copy link
Member

@TriMoon I'm not quite sure what you're going for. We have an ES module here. 🤷‍♂️

@TriMoon
Copy link
Author

TriMoon commented Oct 1, 2019

@TriMoon I'm not quite sure what you're going for. We have an ES module here. man_shrugging

Unfortunatly thats not a real ES module as it requires node-modules, see https://github.com/FortAwesome/vue-fontawesome/blob/master/index.es.js#L1 (It imports from a @namespace...)

@d9beuD
Copy link

d9beuD commented Nov 7, 2019

To have it working in the browser, I had to replace

import { library } from '@fortawesome/fontawesome-svg-core'

with

import { library } from 'path/to/fontawesome-svg-core/index.es.js'

@robmadole
Copy link
Member

Ah, we don't have a browser ES module yet. This lib is not compatible with that yet.

@d9beuD
Copy link

d9beuD commented Nov 12, 2019

Many projects do not rely on nodejs and need a browser ES module. Will this lib be compatible with that in the future?

@robmadole
Copy link
Member

We have an AMD/UMD bundle here:

https://github.com/FortAwesome/vue-fontawesome/blob/master/index.js

But we don't have an ES module that works in the browser because this project depends on other projects and I don't know how to sort that out efficiently.

Maybe you all can help. This project uses Rollup.js (config right here). How does this need to be re-written so that it works for everyone, regardless of how they are hosting this library or using a CDN?

@d9beuD
Copy link

d9beuD commented Nov 12, 2019

As I can see on Rollup.js Quick start docs, the output format for browsers is iife. Maybe it is sufficient to add this in your config?

@robmadole
Copy link
Member

@d9beuD this doesn't produce a ES module. I'll keep reading and researching to see if there is a way to make this happen.

@d9beuD
Copy link

d9beuD commented Nov 24, 2019

Vue.js has a browser ES module, take a look at this line in their package.json file. Hope this will help.

@TriMoon
Copy link
Author

TriMoon commented Feb 19, 2020

Any progress on this topic yet? 3 months have passed...

@robmadole
Copy link
Member

PRs are welcome!

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

3 participants