diff --git a/package.json b/package.json index d01d78b..ada2637 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@leaphy-robotics/picotool-wasm", - "version": "1.0.0", + "version": "1.0.1", "main": "dist/index.cjs", "module": "dist/index.mjs", "types": "dist/index.d.ts", @@ -22,6 +22,7 @@ "url": "https://github.com/leaphy-robotics/picotool-wasm/issues" }, "devDependencies": { + "esbuild-plugin-replace-regex": "^0.0.2", "tsup": "^8.0.2", "typescript": "^5.4.2" } diff --git a/tsconfig.json b/tsconfig.json index e075f97..3642e31 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -82,7 +82,7 @@ "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ /* Type Checking */ - "strict": true, /* Enable all strict type-checking options. */ + "strict": false, /* Enable all strict type-checking options. */ // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ diff --git a/tsup.config.ts b/tsup.config.ts index 8fced73..d163c5e 100644 --- a/tsup.config.ts +++ b/tsup.config.ts @@ -1,4 +1,5 @@ import { defineConfig } from 'tsup' +import replace from 'esbuild-plugin-replace-regex' export default defineConfig({ target: 'es2020', @@ -6,5 +7,16 @@ export default defineConfig({ splitting: false, sourcemap: true, clean: true, - dts: true + dts: true, + esbuildOptions(options) { + if (!options.define) options.define = {} + options.define['import.meta'] = '{}' + }, + esbuildPlugins: [ + replace({ + patterns: [ + [/ENVIRONMENT_IS_NODE(?! =)/g, 'false'], + ] + }) + ] }) diff --git a/yarn.lock b/yarn.lock index d7dbb39..0530d2c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -403,6 +403,11 @@ emoji-regex@^9.2.2: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72" integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg== +esbuild-plugin-replace-regex@^0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/esbuild-plugin-replace-regex/-/esbuild-plugin-replace-regex-0.0.2.tgz#30eaaeb35aeba65edc5c452c20751d59d78c4851" + integrity sha512-kU3zfnr7cNMC5S0xIY+RdiFcJrUr1P892QAdFsD3FSefUk0C6rEWb1Oz/paRbwrU73x+Bu9YiwoenbtqSmtykg== + esbuild@^0.19.2: version "0.19.12" resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.19.12.tgz#dc82ee5dc79e82f5a5c3b4323a2a641827db3e04"