Skip to content

[feat] export a visualization that works without a server #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jpvincent opened this issue Mar 4, 2021 · 2 comments
Open

[feat] export a visualization that works without a server #21

jpvincent opened this issue Mar 4, 2021 · 2 comments

Comments

@jpvincent
Copy link

Hi!
Thank you for the option to save a visualization of a test, it helps sharing and having an history of a project to further compare.

The current exported index.html file can not be simply dragged and dropped to a browser, we have to serve it from an http server in order to see anything. Like webpack-bundle-analyzer, it would be easier to not need a server at all.
There is paths problems that can be corrected manually from the exported HTML :

- <script src="/client.a5432830.js">
+ <script src="./client.a5432830.js">

but after this there is more serious issues, the first one coming from Fetching a local file
client.a5432830.js:1080 Fetch API cannot load file:///…/dist/treeData.json. URL scheme must be "http" or "https" for CORS request.

The way webpack-bundle-analyzer does it is to put all JS, JSON and even images directly into the HTML, saving the full visualization into one file.
Would it be possible to do it this way ?

@aholachek
Copy link
Owner

Hi, I think there are more assets required for bundle wizard than for webpack-bundle-analyzer, so it might be complex. Right now I just build everything with parcel on default settings, and it would probably require some investigation to figure out how to tweak that to get a one-file build. I don't think this is something I will explore, but I'd be open to checking out prs.

@jpvincent
Copy link
Author

Thanks for the answer and the details, I hope to find some time to propose you something.

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants