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.

generate standalone HTML file

See original GitHub issue

We archive reports per build and that includes source-map-explorer’s output. The HTML file is generated as follows

source-map-explorer dist/bundle.min.js \
  --replace "`node -e 'console.log(process.cwd())'`/dist/" --with '' \
  --html > reports/bundle-size.html

When opening that file the screen remains empty, because the following resources could not be loaded:

  • file:///-path-to-project/node_modules/source-map-explorer/node_modules/underscore/underscore.js
  • file:///-path-to-project/node_modules/source-map-explorer/vendor/webtreemap.css
  • file:///-path-to-project/node_modules/source-map-explorer/vendor/webtreemap.js

Those files could either be inlined - so everything is contained in the generated HTML. Or source-map-explorer could accept a destination path and copy the required resources to it. E.g.

source-map-explorer dist/bundle.min.js \
  --replace "`node -e 'console.log(process.cwd())'`/dist/" --with '' \
  --html \
  --destination reports/gustav

would create the following structure

reports/gustav
  index.html
  underscore.js
  webtreemap.css
  webtreemap.js

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
danvkcommented, Apr 11, 2016

This was fixed by #33 and released as 1.3.1.

0reactions
rodneyrehmcommented, Apr 10, 2016

PR #30 shows the original --destination idea, although the option is now called --directory.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Save HTML As Standalone Page: Exporting Tool?
Monolith is a CLI tool for saving complete web pages as a single HTML file. See https://github.com/Y2Z/monolith.
Read more >
Create standalone HTML files #48 - mermaid-js/mermaid-cli
I think the easiest approach is to embed the JS file from a CDN, or render to svg and drop it in the...
Read more >
Create static HTML files - Alpha Anywhere Documentation
Generate a static HTML version of your UX component. Several different files will be generated (e.g. .html, .css, .js, etc.).
Read more >
How to create a standalone HTML web page
Hi, Is it possible to run html js app as standalone html web page juste like kendo ui by adding jquery script and...
Read more >
Creating an HTML Packager - Rick Strahl's Web Log
A single self-contained HTML file with all resources embedded; An HTML file ... Create a zip file package of HTML file plus dependencies:....
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