Skip to content

Commit 5fa69dd

Browse files
committed
don't bundle ES module
bundling entire library into one ES module disables tree-shaking in Webpack
1 parent 01cf1e3 commit 5fa69dd

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "3.7.0",
44
"description": "An open source and production-ready motion library for React on the web",
55
"main": "dist/framer-motion.cjs.js",
6-
"module": "dist/framer-motion.es.js",
6+
"module": "dist/es/index.js",
77
"types": "types/index.d.ts",
88
"author": "Framer Motion",
99
"license": "MIT",

rollup.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,10 @@ const cjs = Object.assign({}, config, {
6363

6464
const es = Object.assign({}, config, {
6565
output: {
66-
file: `dist/${pkg.name}.es.js`,
6766
format: "es",
6867
exports: "named",
68+
preserveModules: true,
69+
dir: "dist/es",
6970
},
7071
plugins: [resolve()],
7172
external,

0 commit comments

Comments
 (0)