fix export

This commit is contained in:
Robin Appelman 2020-02-01 02:32:54 +01:00
commit 9b0901cdf4
3 changed files with 6 additions and 4 deletions

View file

@ -1,7 +1,7 @@
import {FlatState, XY} from '../pkg/index.d.ts'; import {FlatState, XY} from '../pkg/tf_demos_viewer.d.ts';
export async function parseDemo(bytes: Uint8Array): Promise<ParsedDemo> { export async function parseDemo(bytes: Uint8Array): Promise<ParsedDemo> {
let m = await import("../pkg/index.js"); let m = await import("../pkg/tf_demos_viewer.js");
const state = m.parse_demo(bytes); const state = m.parse_demo(bytes);
let playerCount = state.player_count; let playerCount = state.player_count;

View file

@ -2,7 +2,7 @@
"compilerOptions": { "compilerOptions": {
"noImplicitAny": true, "noImplicitAny": true,
"module": "esnext", "module": "esnext",
"target": "es6", "target": "es5",
"allowJs": true "allowJs": true
} }
} }

View file

@ -12,7 +12,9 @@ module.exports = {
}, },
output: { output: {
path: dist, path: dist,
filename: "[name].js" filename: "[name].js",
globalObject: "this",
libraryTarget: 'commonjs'
}, },
devServer: { devServer: {
contentBase: dist, contentBase: dist,