File tree Expand file tree Collapse file tree 1 file changed +22
-5
lines changed
Expand file tree Collapse file tree 1 file changed +22
-5
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,11 @@ ArrayBuffer loader for webpack
1111[ ![ FOSSA Status] ( https://app.fossa.io/api/projects/git%2Bgithub.com%2Fpine%2Farraybuffer-loader.svg?type=shield )] ( https://app.fossa.io/projects/git%2Bgithub.com%2Fpine%2Farraybuffer-loader?ref=badge_shield )
1212
1313
14+ ## Supported Platforms
15+
16+ - Modern Browsers (IE >= 10)
17+ - Node.js
18+
1419## Getting Started
1520
1621
@@ -25,16 +30,28 @@ $ npm install arraybuffer-loader --save-dev
2530```
2631
2732## Usage
28-
29- See offical document [ Loaders] ( https://webpack.js.org/concepts/loaders/ ) .
33+ If you read only the specific extensions (e.g. wasm), please add loader in ` webpack.config.js ` .
3034
3135``` js
32- var buffer = require (' arraybuffer!./data.dat' )
33- var array = new Uint8Array (buffer)
36+ module: {
37+ loaders: [
38+ {
39+ test: / \. wasm$ / ,
40+ loaders: [' arraybuffer-loader' ],
41+ },
42+ ],
43+ },
44+ ```
3445
35- // Enjoy!!
46+ Or if reading an arbitrary extension, use ` require ` .
47+
48+ ``` js
49+ const buffer = require (' arraybuffer!./data.dat' )
50+ const array = new Uint8Array (buffer)
3651```
3752
53+ See also offical document [ Loaders] ( https://webpack.js.org/concepts/loaders/ ) .
54+
3855## License
3956MIT © ; Pine Mizune
4057
You can’t perform that action at this time.
0 commit comments