cesium icon indicating copy to clipboard operation
cesium copied to clipboard

Extra package.jsons in npm pack

Open chris-cooper opened this issue 2 years ago • 1 comments

There are some extra package.json files that are being published to NPM now (1.96) from the Workers directory. Is this intentional?

/tmp/test-cesium-1.96/node_modules/cesium$ find . -name 'package.json'
./Source/ThirdParty/Workers/package.json
./Source/Workers/package.json
./package.json
./Build/Cesium/ThirdParty/Workers/package.json
./Build/Cesium/Workers/package.json
./Build/CesiumUnminified/ThirdParty/Workers/package.json
./Build/CesiumUnminified/Workers/package.json
./Build/package.json

vs

tmp/test-cesium-1.95/node_modules/cesium$ find . -name 'package.json'
./package.json
./Build/package.json

chris-cooper avatar Aug 07 '22 23:08 chris-cooper

@chris-cooper I believe this is intentional because we want the workers to be considered CommonJS rather than ES modules.

@ggetz Could you confirm?

sanjeetsuhag avatar Aug 08 '22 20:08 sanjeetsuhag

Yes, this uses the type field (only used by NodeJS, not npm) to specify how the worker files are loaded. Specifically, this is needed due to the inclusion of requireJS in cesiumWorkerBootstrapper. Once workers can be overhauled and requireJS is no longer needed (waiting on https://bugzilla.mozilla.org/show_bug.cgi?id=1247687), then we should be able to remove this.

I'm going to go ahead and close this, but if you think there's an issue with this, please feel free to re-open. Thanks!

ggetz avatar Aug 17 '22 17:08 ggetz