Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

chore: Disable tree shake for modules under #11509

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion packages/amis-core/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,21 @@ function getPlugins(format = 'esm') {
${name} v${version}
Copyright 2018<%= moment().format('YYYY') > 2018 ? '-' + moment().format('YYYY') : null %> ${author}
`
})
}),
{
name: 'disable-treeshake',
transform(code, id) {
if (/\/src\/renderers\//.test(id)) {
// Disable tree shake for modules under `src/renderers`
return {
code,
map: null,
moduleSideEffects: 'no-treeshake'
};
}

return null;
}
}
].filter(item => item);
}
18 changes: 17 additions & 1 deletion packages/amis/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,22 @@ function getPlugins(format = 'esm') {
build time: <%=moment().format('YYYY-MM-DD')%>
Copyright 2018<%= moment().format('YYYY') > 2018 ? '-' + moment().format('YYYY') : null %> ${author}
`
})
}),

{
name: 'disable-treeshake',
transform(code, id) {
if (/\/src\/renderers\//.test(id)) {
// Disable tree shake for modules under `src/renderers`
return {
code,
map: null,
moduleSideEffects: 'no-treeshake'
};
}

return null;
}
}
].filter(item => item);
}
Loading