mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-14 15:31:31 +00:00
Progress and a tiny WASM binary parser
This commit is contained in:
37
lib/parse/webpack.config.js
Normal file
37
lib/parse/webpack.config.js
Normal file
@ -0,0 +1,37 @@
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const webpack = require("webpack");
|
||||
|
||||
const wasmData = fs.readFileSync(__dirname + "/build/index.wasm");
|
||||
|
||||
module.exports = {
|
||||
entry: [ "./src/index.ts" ],
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.ts$/,
|
||||
use: "ts-loader",
|
||||
exclude: /node_modules/
|
||||
}
|
||||
]
|
||||
},
|
||||
resolve: {
|
||||
extensions: [ ".ts", ".js" ]
|
||||
},
|
||||
node: {
|
||||
fs: false
|
||||
},
|
||||
output: {
|
||||
filename: "index.js",
|
||||
path: __dirname,
|
||||
library: "asparse",
|
||||
libraryTarget: "umd",
|
||||
globalObject: "typeof self !== 'undefined' ? self : this"
|
||||
},
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
WASM_DATA: JSON.stringify(wasmData.toString("base64"))
|
||||
})
|
||||
],
|
||||
devtool: "source-map"
|
||||
};
|
Reference in New Issue
Block a user