question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Build as a single file for use in a <script>?

See original GitHub issue

Hi, I’m working on 2m2d whose webserver is written in Rust, so I can’t use npm for the frontend (It has to be static sites only). Is there a way to build this library as a single file so I can load it in a <script> tag?

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
codediodeiocommented, Aug 17, 2022

Clone it and run npm run build to generate the main.js bundle, then use it in a module script:

<script type="module">
  import flamethrower from '/path/to/main.js';
  const router = flamethrower();
</script>
0reactions
miczizcommented, Aug 27, 2022

Another option is to use the ESM CDN as shown here #31

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create a single file for application deployment - .NET
Bundling all application-dependent files into a single binary provides an application developer with the attractive option to deploy and ...
Read more >
Typescript compile to single file - javascript - Stack Overflow
Probably, the best option is to use a module bundler / build tool, like Webpack. Webpack will compile all your TypeScript files to...
Read more >
Build Script Basics - Gradle User Manual
You run a Gradle build using the gradle command. The gradle command looks for a file called build.gradle in the current directory. ......
Read more >
Build scripts - IBM
A build script is a file that is started by a build plan. The build script prepares output from generated files. The following...
Read more >
Build Single File for Distribution · Issue #1452 - GitHub
I'm building a small app that will need to act as a library for a client. They will need to pull a single...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found