-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
137 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Document</title> | ||
<script> | ||
window.analyzeModule = [] | ||
window.defaultSizes = 'parsed' | ||
</script> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<!-- <script type="module" src="./main.js"></script> --> | ||
<script type="module" src="./react.jsx"></script> | ||
</body> | ||
</html> |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { AnalyzerClient } from 'vite-bundle-analyzer/sdk/browser' | ||
import 'vite-bundle-analyzer/sdk/browser.css' | ||
import data from '../../src/client/data.json' with { type: 'json' } | ||
|
||
const client = new AnalyzerClient() | ||
|
||
client.render('#app') | ||
|
||
client.setOptions({ | ||
sizes: 'statSize', | ||
analyzeModule: data | ||
}) |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "sdk-example", | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "vite build", | ||
"preview": "vite preview" | ||
}, | ||
"dependencies": { | ||
"vite-bundle-analyzer": "workspace: *" | ||
} | ||
} |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import React, { useEffect } from 'react' | ||
import DOM from 'react-dom' | ||
import ReactDOM from 'react-dom/client' | ||
import { AnalyzerClient } from 'vite-bundle-analyzer/sdk/browser' | ||
import 'vite-bundle-analyzer/sdk/browser.css' | ||
import data from '../../src/client/data.json' with { type: 'json' } | ||
|
||
const element = document.querySelector('#app') | ||
|
||
export function App() { | ||
const client = new AnalyzerClient() | ||
useEffect(() => { | ||
client.render('#app') | ||
client.setOptions({ | ||
sizes: 'statSize', | ||
analyzeModule: data | ||
}) | ||
}, []) | ||
|
||
return <div /> | ||
} | ||
|
||
ReactDOM.createRoot(element).render( | ||
<React.StrictMode> | ||
<App /> | ||
</React.StrictMode> | ||
) |
Empty file.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters