Skip to content

Commit

Permalink
fix: replace Snowpack with Vite in integrations/react
Browse files Browse the repository at this point in the history
Snowpack is broken by FredKSchott/snowpack#3281
  • Loading branch information
rossng committed Jul 11, 2021
1 parent 8557bec commit dbe386d
Show file tree
Hide file tree
Showing 9 changed files with 1,836 additions and 5,038 deletions.
2 changes: 1 addition & 1 deletion integrations/react/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
<body>
<div id="root"></div>
<noscript>You need to enable JavaScript to run this app.</noscript>
<script type="module" src="/test/src/index.js"></script>
<script type="module" src="/test/src/index.tsx"></script>
</body>
</html>
6,784 changes: 1,790 additions & 4,994 deletions integrations/react/package-lock.json

Large diffs are not rendered by default.

23 changes: 12 additions & 11 deletions integrations/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,25 @@
},
"scripts": {
"build": "rimraf dist && npm run build:cjs && npm run build:esm",
"build:cjs": "tsc --target es5 --module commonjs --outDir dist/cjs",
"build:esm": "tsc --target es6 --module es6 --outDir dist/esm",
"serve": "snowpack dev"
"build:cjs": "tsc --target es5 --module commonjs --outDir dist/cjs --project tsconfig.build.json",
"build:esm": "tsc --target es6 --module es6 --outDir dist/esm --project tsconfig.build.json",
"serve": "concurrently vite \"npm run lint\"",
"lint": "tsc --project tsconfig.json --watch"
},
"dependencies": {
"@seznam/compose-react-refs": "^1.0.4",
"@vime/core": "5.0.30"
},
"devDependencies": {
"@snowpack/plugin-react-refresh": "^2.3.9",
"@snowpack/plugin-typescript": "^1.1.1",
"@types/react": "^16.9.9",
"@types/react-dom": "^16.9.9",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"@types/react": "^17.0.14",
"@types/react-dom": "^17.0.9",
"@vitejs/plugin-react-refresh": "^1.3.5",
"concurrently": "^6.2.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"rimraf": "^3.0.2",
"snowpack": "^2.0.0",
"typescript": "^4.0.2"
"typescript": "^4.3.5",
"vite": "^2.4.1"
},
"peerDependencies": {
"react": "^17.0.0",
Expand Down
12 changes: 0 additions & 12 deletions integrations/react/snowpack.config.js

This file was deleted.

6 changes: 5 additions & 1 deletion integrations/react/test/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ function App() {

return (
<div id="container">
<Player playsinline ref={player} onVmPlaybackReady={onPlaybackReady}>
<Player
playsinline={true}
ref={player}
onVmPlaybackReady={onPlaybackReady}
>
{/* YOUTUBE */}
{/* <Youtube videoId="DyTCOwB0DVw" /> */}

Expand Down
14 changes: 14 additions & 0 deletions integrations/react/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"declaration": true,
"removeComments": false,
"sourceMap": true,
"declarationDir": "dist/types",
"inlineSources": true,
"skipLibCheck": true
},
"include": ["src/**/*.ts", "src/**/*.tsx"],
"compileOnSave": false,
"buildOnSave": false
}
17 changes: 7 additions & 10 deletions integrations/react/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
{
"extends": "../../tsconfig.json",
"extends": "./tsconfig.build.json",
"compilerOptions": {
"declaration": true,
"removeComments": false,
"sourceMap": true,
"declarationDir": "dist/types",
"inlineSources": true,
"skipLibCheck": true
"noEmit": true,
"module": "ES2020",
"noUnusedLocals": false,
"jsx": "preserve",
"preserveWatchOutput": true,
},
"include": ["src/**/*.ts", "src/**/*.tsx"],
"compileOnSave": false,
"buildOnSave": false
"include": ["src/**/*.ts", "src/**/*.tsx", "test/**/*.ts", "test/**/*.tsx"]
}
9 changes: 0 additions & 9 deletions integrations/react/tsconfig.snowpack.json

This file was deleted.

7 changes: 7 additions & 0 deletions integrations/react/vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { defineConfig } from 'vite';
import reactRefresh from '@vitejs/plugin-react-refresh';

// https://vitejs.dev/config/
export default defineConfig({
plugins: [reactRefresh()],
});

0 comments on commit dbe386d

Please sign in to comment.