Comments (4)
Or even use
<script type="module">
import flamethrower from 'https://esm.sh/v90/flamethrower-router'
flamethrower({ log: true, pageTransitions: true });
</script>
To use an ESM cdn to play around with.
@Oskar1504 Just a tip: type="module"
is automatically deferred. Technically you can have async
modules but not blocking modules, so defer is default.
from flamethrower.
Insert in your <head></head>
<script defer type="module">
import flamethrower from '/flamethrower.js';
flamethrower({ log: true, pageTransitions: true });
</script>
Use <a href="/test"></a>
elements as always.
Should work
from flamethrower.
Insert in your
<head></head>
<script defer type="module"> import flamethrower from '/flamethrower.js'; flamethrower({ log: true, pageTransitions: true }); </script>Use
<a href="/test"></a>
elements as always. Should work
just a little addition clone it and run npm run build to generate the main.js bundle, then use it in a module script.
from flamethrower.
How about an example/video on how to use it without npm...
@IBIT-ZEE
Below examples use import
AKA they presume ES6 modules.
You could also include from unpkg, since Jeff published this to npm:
<script href="https://unpkg.com/[email protected]/dist/main.umd.cjs">
URL found via the ending-slash trick:
https://unpkg.com/flamethrower-router/
NOTE: I haven't tried this yet, but it seems to use the standard Universal Module Definition
from flamethrower.
Related Issues (20)
- Counter Example HOT 2
- Head not remove old node
- Head tag not remove old node
- Title is not updating HOT 5
- Unable to get out of the site using browser's navigation button HOT 1
- [help] cannot find imported module HOT 5
- Add the all contributors spec.
- Add linkSelector option HOT 1
- Discussion: what are the differences between it and Navigo? HOT 1
- Deno support? HOT 6
- flamefthrower-preserve
- Flamethrower breaks mermaid.js HOT 2
- Does it work with SSGs? Especially for Astro. HOT 2
- Uncaught TypeError: Cannot read properties of undefined (reading 'log') HOT 1
- Keep existing target in <a> HOT 1
- Usage with Svelte HOT 1
- Why is flamethrower handling scrolls to ids? HOT 2
- Can't read url with href="#" HOT 1
- <script type="module"> is not re-run when replacing the body HOT 1
- Where's the demo!
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flamethrower.