This webpack loader adds support for Kaitai Struct .ksy definitions.
yarn add --dev kaitai-struct-loader
file.js
import KaitaiStream from 'kaitai-struct/KaitaiStream';
import DoomWAD from './game/doom_wad.ksy';
const stream = new KaitaiStream(arrayBuffer);
const data = new DoomWAD(stream);
The specification of the Doom .wad format can be found in the format gallery.
webpack.config.js
module.exports = {
module: {
rules: [
{
test: /\.ksy$/,
use: [{
loader: 'kaitai-struct-loader',
// options: { debug: true },
}],
},
]
}
}
Name | Type | Default | Description |
---|---|---|---|
debug |
{boolean} |
false |
Compile .ksy files in --debug mode(see #332 for more info) |