vue-fontawesome icon indicating copy to clipboard operation
vue-fontawesome copied to clipboard

Use without build

Open TriMoon opened this issue 5 years ago • 11 comments

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?

TriMoon avatar Jun 10 '19 10:06 TriMoon

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

robmadole avatar Aug 31 '19 13:08 robmadole

@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...)

TriMoon avatar Oct 01 '19 07:10 TriMoon

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'

d9beuD avatar Nov 07 '19 11:11 d9beuD

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

robmadole avatar Nov 08 '19 20:11 robmadole

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

d9beuD avatar Nov 12 '19 08:11 d9beuD

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?

robmadole avatar Nov 12 '19 13:11 robmadole

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?

d9beuD avatar Nov 12 '19 15:11 d9beuD

@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.

robmadole avatar Nov 12 '19 15:11 robmadole

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

d9beuD avatar Nov 24 '19 10:11 d9beuD

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

TriMoon avatar Feb 19 '20 12:02 TriMoon

PRs are welcome!

robmadole avatar Feb 19 '20 14:02 robmadole