Created
March 29, 2021 14:32
-
-
Save jaschaio/321e794e7f8fb15d4bf9dfa0da46656c to your computer and use it in GitHub Desktop.
Revisions
-
jaschaio created this gist
Mar 29, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="description" content="Starter Snowpack App" /> <title>Starter Snowpack App</title> <script type='module' src="/index.js"></script> </head> <body> <h1>Welcome to Snowpack!</h1> </body> </html> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ import { library, icon } from '@fortawesome/fontawesome-svg-core'; const getIcon = async ( { icon: iconToFetch } ) => { const { [ iconToFetch ]: importedIcon } = await import( `@fortawesome/free-brands-svg-icons/${ iconToFetch }.js` ); library.add( importedIcon ); return icon( importedIcon, { classes } ).html } ( async () => { const html = await getIcon( { icon: 'faFacebook' } ); document.body.innerHTML = html; } )(); This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ { "name": "failed-to-resolve-example", "version": "1.0.0", "description": "", "main": "index.js", "dependencies": { "@fortawesome/fontawesome-svg-core": "^1.2.35", "@fortawesome/free-brands-svg-icons": "^5.15.3" }, "devDependencies": { "snowpack": "^3.1.2" }, "scripts": { "start": "snowpack dev", "build": "snowpack build" }, "author": "", "license": "ISC" }