Skip to content

Commit

Permalink
build: replaced abandoned rollup-plugin-rename-node-modules with buil…
Browse files Browse the repository at this point in the history
…t-in entryFileNames
  • Loading branch information
glebcha committed Nov 21, 2024
1 parent 7d4167f commit 7edf358
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 0 additions & 2 deletions build-utils/getInputOptions.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { nodeResolve } from '@rollup/plugin-node-resolve';
import replace from '@rollup/plugin-replace';
import esbuild from 'rollup-plugin-esbuild'
import filesize from 'rollup-plugin-filesize';
import renameNodeModules from 'rollup-plugin-rename-node-modules';

export function getInputOptions({ moduleType, names, paths }) {
const isESM = moduleType === 'es';
Expand All @@ -27,7 +26,6 @@ export function getInputOptions({ moduleType, names, paths }) {
sourceMap: false,
include: '**/node_modules/**',
}),
isESM && renameNodeModules('esm-dependencies', false),
!isESM && filesize({ showBrotliSize: true }),
],
};
Expand Down
7 changes: 7 additions & 0 deletions build-utils/getOutputOptions.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ export function getOutputOptions({ moduleType, version, names, paths }) {
{
format: moduleType,
sourcemap: !isESM,
entryFileNames: (chunkInfo) => {
if (isESM && chunkInfo.name.includes('node_modules')) {
return chunkInfo.name.replace('node_modules', 'esm-dependencies') + '.js';
}

return '[name].js';
}
},
isESM ?
{
Expand Down

0 comments on commit 7edf358

Please sign in to comment.