Skip to content

Commit

Permalink
chore: update vite and config on dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
yaodingyd committed Jan 2, 2025
1 parent 085792a commit f14e76d
Show file tree
Hide file tree
Showing 10 changed files with 2,347 additions and 1,532 deletions.
10 changes: 0 additions & 10 deletions build-docs.mjs

This file was deleted.

30 changes: 0 additions & 30 deletions build.mjs

This file was deleted.

1 change: 1 addition & 0 deletions examples/App.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Flickity from '../src/index.js'
import './App.css'
import React from 'react'

import Default from './Default.jsx'
import Static from './Static.jsx'
Expand Down
2 changes: 1 addition & 1 deletion examples/Default.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useState } from 'react'
import React, { useState } from 'react'
import Flickity from '../src/index.js'
import { images } from './images.js'

Expand Down
2 changes: 1 addition & 1 deletion examples/Static.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useState } from 'react'
import React, { useState } from 'react'
import Flickity from '../src/index.js'
import { images } from './images.js'

Expand Down
3 changes: 2 additions & 1 deletion index.html → examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="https://unpkg.com/flickity@2/dist/flickity.min.css">
<title>React-Flickity-Component</title>
<script type="module" src="/examples/main.jsx"></script>
<script type="module" src="main.jsx"></script>
</head>
<body>
<div id="root"></div>
</body>
</html>
4 changes: 3 additions & 1 deletion examples/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import ReactDOM from 'react-dom/client'
import App from './App'
import './global.css'

ReactDOM.createRoot(document.body).render(
const domNode = document.getElementById('root');

ReactDOM.createRoot(domNode).render(
<React.StrictMode>
<App />
</React.StrictMode>,
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
"scripts": {
"pretty": "prettier --single-quote --trailing-comma es5 --write \"src/**/*.js\" \"examples/**/*.jsx\"",
"test": "vitest",
"dev": "vite",
"build": "node build.mjs",
"build:docs": "node build-docs.mjs",
"prepublishOnly": "node build.mjs"
"dev": "vite serve ./examples",
"build": "vite build",
"build:docs": "vite build --mode docs",
"prepublishOnly": "vite build"
},
"author": "theolampert",
"license": "GPL3",
Expand All @@ -46,13 +46,13 @@
"@testing-library/react": "^13.4.0",
"@types/react": "^18.0.26",
"@types/react-dom": "^18.0.9",
"@vitejs/plugin-react": "^3.0.0",
"@vitejs/plugin-react": "^4.0.0",
"flickity": "^2.2.1",
"jsdom": "^20.0.3",
"prettier": "^2.8.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"vite": "^4.0.0",
"vite": "^6.0.0",
"vitest": "^0.25.7"
},
"peerDependencies": {
Expand Down
Loading

0 comments on commit f14e76d

Please sign in to comment.