Skip to content

Commit ce3451e

Browse files
iOvergaardclaude
andcommitted
refactor(build): move side-effect config to vite.config, clean up package.json
Replace src/ patterns in package.json#sideEffects with treeshake.moduleSideEffects: true in rolldownOptions. The sideEffects field is a public contract for consumer bundlers — it should only describe published dist/ files, not src/ files that are never shipped. Build-time side-effect behaviour belongs in the build config. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 320a3cd commit ce3451e

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@
2020
"sideEffects": [
2121
"!dist/components/**/*.element.js",
2222
"!dist/internal/index.js",
23-
"!src/components/**/*.element.ts",
24-
"!src/internal/index.ts",
25-
"dist/**/*.js",
26-
"src/**/*.ts"
23+
"dist/**/*.js"
2724
],
2825
"customElements": "custom-elements.json",
2926
"files": [

vite.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export default defineConfig({
3838
},
3939
rolldownOptions: {
4040
external: [/^lit/, /^culori/],
41+
treeshake: { moduleSideEffects: true },
4142
output: {
4243
preserveModules: true,
4344
preserveModulesRoot: 'src',

0 commit comments

Comments
 (0)