Skip to content

Commit a0916c7

Browse files
author
v1rtl
committed
remove babel and only keep typescript
1 parent 0c464b4 commit a0916c7

File tree

5 files changed

+20
-1267
lines changed

5 files changed

+20
-1267
lines changed

package.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,10 @@
4949
"three-stdlib": "^2.21.10"
5050
},
5151
"devDependencies": {
52-
"@babel/core": "^7.21.4",
53-
"@babel/plugin-transform-runtime": "7.21.4",
54-
"@babel/preset-env": "^7.21.4",
55-
"@babel/preset-react": "7.18.6",
56-
"@babel/preset-typescript": "^7.21.4",
5752
"@react-three/fiber": "^8.13.0",
58-
"@rollup/plugin-babel": "^6.0.3",
5953
"@rollup/plugin-commonjs": "^24.1.0",
6054
"@rollup/plugin-node-resolve": "^15.0.2",
55+
"@rollup/plugin-typescript": "^11.1.0",
6156
"@types/react": "^18.2.0",
6257
"@types/react-dom": "^18.2.1",
6358
"@types/three": "^0.150.2",

rollup.config.js

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,23 @@
11
import path from 'path'
2-
import { babel } from '@rollup/plugin-babel'
32
import resolve from '@rollup/plugin-node-resolve'
43
import filesize from 'rollup-plugin-filesize'
4+
import typescript from '@rollup/plugin-typescript'
55

66
const root = process.platform === 'win32' ? path.resolve('/') : '/'
77
const external = (id) => !id.startsWith('.') && !id.startsWith(root)
88
const extensions = ['.js', '.jsx', '.ts', '.tsx']
99

10-
const getBabelOptions = ({ useESModules }, targets) => ({
11-
babelrc: false,
12-
extensions,
13-
exclude: '**/node_modules/**',
14-
babelHelpers: 'runtime',
15-
presets: [
16-
['@babel/preset-env', { loose: true, modules: false, targets }],
17-
'@babel/preset-react',
18-
'@babel/preset-typescript',
19-
],
20-
plugins: [['@babel/transform-runtime', { regenerator: false, useESModules }]],
21-
})
22-
2310
export default [
2411
{
2512
input: `./src/index.tsx`,
2613
output: { file: `dist/index.js`, format: 'esm' },
2714
external,
28-
plugins: [
29-
babel(getBabelOptions({ useESModules: true }, '>5%, not dead, not ie 11, not op_mini all, node >=12')),
30-
filesize(),
31-
resolve({ extensions }),
32-
],
15+
plugins: [typescript(), resolve({ extensions }), filesize()],
3316
},
3417
{
3518
input: `./src/index.tsx`,
3619
output: { file: `dist/index.cjs`, format: 'cjs' },
3720
external,
38-
plugins: [babel(getBabelOptions({ useESModules: false })), filesize(), resolve({ extensions })],
21+
plugins: [typescript(), resolve({ extensions }), filesize()],
3922
},
4023
]

src/Selection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export function Select({ enabled = false, children, ...props }: SelectApi) {
3636
}
3737
}
3838
}
39-
}, [enabled, children])
39+
}, [enabled, children, api])
4040
return (
4141
<group ref={group} {...props}>
4242
{children}

src/effects/Pixelation.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { forwardRef, useMemo, Ref } from 'react'
1+
import { forwardRef, useMemo, Ref } from 'react'
22
import { PixelationEffect } from 'postprocessing'
33

44
export type PixelationProps = {

0 commit comments

Comments
 (0)