Skip to content

Commit

Permalink
Enable tree shaking in Vue package (#859)
Browse files Browse the repository at this point in the history
  • Loading branch information
santi authored Oct 29, 2021
1 parent fd4669f commit c57eb60
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/@headlessui-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
"description": "A set of completely unstyled, fully accessible UI components for Vue 3, designed to integrate beautifully with Tailwind CSS.",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"module": "dist/headlessui.esm.js",
"module": "dist/index.esm.js",
"license": "MIT",
"files": [
"README.md",
"dist"
],
"sideEffects": false,
"engines": {
"node": ">=10"
},
Expand Down
7 changes: 6 additions & 1 deletion packages/@headlessui-vue/tsdx.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@ const globals = {
}

module.exports = {
rollup(config) {
rollup(config, opts) {
for (let key in globals) config.output.globals[key] = globals[key]
if (opts.format === 'esm') {
config = { ...config, preserveModules: true }
config.output = { ...config.output, dir: 'dist/', entryFileNames: '[name].esm.js' }
delete config.output.file
}
return config
},
}

0 comments on commit c57eb60

Please sign in to comment.