Skip to content

Commit

Permalink
chore: reduce publish size
Browse files Browse the repository at this point in the history
  • Loading branch information
SukkaW committed Dec 10, 2024
1 parent 2a96133 commit c9f724e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 20 deletions.
35 changes: 16 additions & 19 deletions rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,22 @@ export default async function () {

return defineConfig([{
input,
output: [{
dir: 'dist',
format: 'commonjs',
entryFileNames: '[name]/index.cjs',
chunkFileNames: 'chunks/[name].[hash].cjs',
compact: true
}, {
dir: 'dist',
format: 'commonjs',
entryFileNames: '[name]/index.js',
chunkFileNames: 'chunks/[name].[hash].js',
compact: true
}, {
dir: 'dist',
format: 'esm',
entryFileNames: '[name]/index.mjs',
chunkFileNames: 'chunks/[name].[hash].mjs',
compact: true
}],
output: [
{
dir: 'dist',
format: 'commonjs',
entryFileNames: '[name]/index.cjs',
chunkFileNames: 'chunks/[name].[hash].cjs',
compact: true
},
{
dir: 'dist',
format: 'esm',
entryFileNames: '[name]/index.mjs',
chunkFileNames: 'chunks/[name].[hash].mjs',
compact: true
}
],
plugins: [
swc({
isModule: true,
Expand Down
2 changes: 1 addition & 1 deletion tools/postbuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ async function createPackageJson(entries: Record<string, string>) {
default: `./${entryName}/index.mjs`
},
require: `./${entryName}/index.cjs`,
default: `./${entryName}/index.js`
default: `./${entryName}/index.cjs`
};
});

Expand Down

0 comments on commit c9f724e

Please sign in to comment.