Skip to content

Commit

Permalink
v0.9.0 tilesets: preEmit, allow esm default exports
Browse files Browse the repository at this point in the history
  • Loading branch information
city41 committed Nov 24, 2023
1 parent eea1a3d commit 33b0740
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@city41/sromcrom",
"version": "0.8.9",
"version": "0.9.0",
"main": "lib/index.js",
"files": [
"lib/**/*.js"
Expand Down
4 changes: 3 additions & 1 deletion src/generators/tilesets/tilesets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ const tilesets: ICROMGenerator<TilesetsJsonSpec> = {
if (preEmit) {
const preEmitPath = path.resolve(rootDir, preEmit);
const preEmitModule = require(preEmitPath);
renderData = preEmitModule(rootDir, tilesets);
// the module may be commonjs or esm
const preEmitFn = preEmitModule.default ?? preEmitModule;
renderData = preEmitFn(rootDir, tilesets);
} else {
renderData = { tilesets };
}
Expand Down

0 comments on commit 33b0740

Please sign in to comment.