Skip to content

Commit

Permalink
Fix #1277: disable preserveModules of rollup configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
samchon committed Sep 19, 2024
1 parent 98ceffb commit e1ede40
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion benchmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,6 @@
"suppress-warnings": "^1.0.2",
"tstl": "^3.0.0",
"uuid": "^9.0.1",
"typia": "../typia-6.10.1-dev.20240919.tgz"
"typia": "../typia-6.10.1-dev.20240920.tgz"
}
}
2 changes: 1 addition & 1 deletion errors/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@
"typescript": "^5.3.2"
},
"dependencies": {
"typia": "../typia-6.10.1-dev.20240919.tgz"
"typia": "../typia-6.10.1-dev.20240920.tgz"
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "typia",
"version": "6.10.1-dev.20240919",
"version": "6.10.1-dev.20240920",
"description": "Superfast runtime validators with only one line",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
Expand Down
16 changes: 10 additions & 6 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,27 @@ module.exports = {
format: "esm",
sourcemap: true,
entryFileNames: (chunkInfo) => {
const ext = `mjs`
const ext = `mjs`;
const externalDir = `_external`;
const nodeModulesDir = `node_modules`;
if (chunkInfo.name.includes(nodeModulesDir)) {
/** replace / to _ and the last part of the path is the file name */
const nameSplit = chunkInfo.name.split('/')
const chunkName = path.join(externalDir, nameSplit.slice(0, -1).join('_'), nameSplit.at(-1))
const nameSplit = chunkInfo.name.split("/");
const chunkName = path.join(
externalDir,
nameSplit.slice(0, -1).join("_"),
nameSplit.at(-1),
);
console.table({
before: chunkInfo.name,
after: chunkName,
})
});
return `${chunkName}.${ext}`;
}
return `[name].${ext}`;
},
preserveModules: true,
preserveModulesRoot: "src",
// preserveModules: true,
// preserveModulesRoot: "src",
},
plugins: [
nodeResolve(),
Expand Down
2 changes: 1 addition & 1 deletion test-esm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@
"typescript": "^5.4.5"
},
"dependencies": {
"typia": "../typia-6.10.1-dev.20240919.tgz"
"typia": "../typia-6.10.1-dev.20240920.tgz"
}
}
2 changes: 1 addition & 1 deletion test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@
"suppress-warnings": "^1.0.2",
"tstl": "^3.0.0",
"uuid": "^9.0.1",
"typia": "../typia-6.10.1-dev.20240919.tgz"
"typia": "../typia-6.10.1-dev.20240920.tgz"
}
}

0 comments on commit e1ede40

Please sign in to comment.