-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove (a)sync entries and add asset entry with an example
- Loading branch information
Showing
14 changed files
with
1,340 additions
and
26 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
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,6 @@ | ||
import type { InitOutput } from './pkg/index.js' | ||
|
||
export type * from './pkg/index.js' | ||
|
||
declare const BrotliDecWasmPromise: Promise<InitOutput> | ||
export default BrotliDecWasmPromise |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { initSync } from './pkg/index.js' | ||
import init from './pkg/index.js' | ||
import wasm from './pkg/index_bg.wasm' | ||
|
||
export * from './pkg/index.js' | ||
|
||
export default initSync(wasm) | ||
export default init(wasm) |
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>webpack asset example</title> | ||
<link rel="stylesheet" href="https://unpkg.com/mvp.css" /> | ||
</head> | ||
<body> | ||
<h1>webpack asset example</h1> | ||
<p id="status"></p> | ||
<script src="dist/index.js"></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,11 @@ | ||
import brotliDecWasmPromise from 'brotli-dec-wasm/asset' | ||
|
||
async function main() { | ||
const brotliDecWasm = await brotliDecWasmPromise | ||
window.brotliDecWasm = brotliDecWasm | ||
} | ||
|
||
main().then(() => { | ||
console.log('init ok') | ||
document.getElementById('status').innerText = 'init ok' | ||
}) |
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,22 @@ | ||
{ | ||
"name": "webpack-asset", | ||
"version": "1.0.0", | ||
"description": "", | ||
"private": true, | ||
"scripts": { | ||
"build": "webpack --config webpack.config.cjs", | ||
"dev": "http-server -c-1 ." | ||
}, | ||
"keywords": [], | ||
"author": "myl7 <myl@myl.moe> (https://myl.moe)", | ||
"license": "MIT OR Apache-2.0", | ||
"type": "module", | ||
"dependencies": { | ||
"brotli-dec-wasm": "link:../.." | ||
}, | ||
"devDependencies": { | ||
"http-server": "^14.1.1", | ||
"webpack": "^5.89.0", | ||
"webpack-cli": "^5.1.4" | ||
} | ||
} |
Oops, something went wrong.