Skip to content

Commit

Permalink
Testing new build process
Browse files Browse the repository at this point in the history
  • Loading branch information
mattgperry committed Dec 7, 2021
1 parent d95f4a8 commit 57afa24
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 37 deletions.
10 changes: 4 additions & 6 deletions dev/examples/ThreeBox.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as React from "react"
import { useRef, useState } from "react"
import { Canvas } from "@react-three/fiber"
import { motion } from "@framer/render/three/motion"
import { motion, MotionCanvas } from "@framer/three-entry"

/**
* An example of firing an animation onMount using the useAnimation hook
Expand Down Expand Up @@ -43,13 +42,12 @@ export const App = () => {
return (
<motion.div
style={{ position: "fixed", inset: 0, background: "white" }}
whileHover="hover"
>
<Canvas>
<MotionCanvas>
<ambientLight />
<pointLight position={[10, 10, 10]} />
<motion.group
initial="hidden"
animate="visible"
variants={{
visible: { transition: { staggerChildren: 0.1 } },
}}
Expand All @@ -64,7 +62,7 @@ export const App = () => {
<Box position={[0, -1.5, 0]} />
<Box position={[1.5, -1.5, 0]} />
</motion.group>
</Canvas>
</MotionCanvas>
</motion.div>
)
}
9 changes: 6 additions & 3 deletions dev/webpack/examples.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Suspense } from "react"
import * as React from "react"
import { fileName } from "../inc/file-name"
import { Container, Code } from "../styled"
Expand Down Expand Up @@ -44,8 +45,10 @@ export const Example = ({ id }: { id: string }) => {
document.title = name

return (
<Container>
<targetModule.App />
</Container>
<Suspense fallback={null}>
<Container>
<targetModule.App />
</Container>
</Suspense>
)
}
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
"name": "framer-motion",
"version": "5.4.1",
"description": "A simple and powerful React animation library",
"main": "dist/framer-motion.cjs.js",
"main": "dist/cjs/index.js",
"module": "dist/es/index.mjs",
"exports": {
".": {
"require": "./dist/framer-motion.cjs.js",
"require": "dist/cjs/index.js",
"import": "./dist/es/index.mjs",
"default": "./dist/framer-motion.cjs.js"
"default": "dist/cjs/index.js"
},
"./three": {
"require": "./dist/framer-motion-three.cjs.js",
"require": "./dist/cjs/three-entry.js",
"import": "./dist/es/three-entry.mjs",
"default": "./dist/framer-motion-three.cjs.js"
"default": "./dist/cjs/three-entry.js"
},
"./package.json": "./package.json"
},
Expand Down
27 changes: 4 additions & 23 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,10 @@ const umdProd = Object.assign({}, umd, {
})

const cjs = Object.assign({}, config, {
input: ["lib/index.js", "lib/three-entry.js"],
output: {
file: `dist/${pkg.name}.cjs.js`,
format: "cjs",
exports: "named",
},
plugins: [resolve()],
external,
})

const threeCjs = Object.assign({}, config, {
input: "lib/three-entry.js",
output: {
file: `dist/${pkg.name}-three.cjs.js`,
entryFileNames: `[name].js`,
dir: "dist/cjs",
format: "cjs",
exports: "named",
},
Expand Down Expand Up @@ -149,14 +140,4 @@ const domMax = Object.assign({}, es, {
external: ["react", "react-dom"],
})

export default [
projection,
umd,
umdProd,
cjs,
threeCjs,
es,
m,
domAnimation,
domMax,
]
export default [projection, umd, umdProd, cjs, es, m, domAnimation, domMax]

0 comments on commit 57afa24

Please sign in to comment.