]> zoso.dev Git - libnemo.git/commitdiff
Indicate to esbuild when browser bundle is being built versus when Node tests are...
authorChris Duncan <chris@zoso.dev>
Tue, 19 Nov 2024 07:10:57 +0000 (23:10 -0800)
committerChris Duncan <chris@zoso.dev>
Tue, 19 Nov 2024 07:10:57 +0000 (23:10 -0800)
package.json

index 4990a99f3ddc1d5a4451e4ee5ccbcb10d5b061e1..5b1046dba21a18631464637436e0598691483c25 100644 (file)
                "package.json.license"
        ],
        "main": "dist/main.js",
-       "browser": "dist/main.min.js",
+       "browser": {
+               "dist/main.min.js": true,
+               "node:worker_threads": false
+       },
        "repository": {
                "type": "git",
                "url": "git+https://zoso.dev/libnemo.git"
        },
        "scripts": {
                "build": "rm -rf dist && tsc && esbuild main.min=dist/main.js global.min=dist/global.js --outdir=dist --target=es2022 --format=esm --platform=browser --bundle --minify --sourcemap",
-               "test": "npm run build && node --test --test-force-exit --env-file .env",
+               "test": "npm run build -- --platform=node && node --test --test-force-exit --env-file .env",
                "test:coverage": "npm run test -- --experimental-test-coverage",
                "test:coverage:report": "npm run test:coverage -- --test-reporter=lcov --test-reporter-destination=coverage.info && genhtml coverage.info --output-directory test/coverage && rm coverage.info && xdg-open test/coverage/index.html"
        },