-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v0.5: Vite 5, ESM, drop support for now builtin
?inline
[publish]
- Loading branch information
1 parent
a1c224c
commit abf86c0
Showing
18 changed files
with
734 additions
and
298 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,25 @@ | ||
{ | ||
"name": "vite-plugin-fast-react-svg", | ||
"version": "0.4.0", | ||
"version": "0.5.0", | ||
"type": "module", | ||
"license": "MIT", | ||
"scripts": { | ||
"build": "scripts/bundle.ts", | ||
"prettier": "yarn prettier-ci --write", | ||
"prettier": "bun prettier-ci --write", | ||
"prettier-ci": "prettier --ignore-path=.gitignore --check '**/*.{ts,json,md,yml}'", | ||
"ci": "tsc && bun prettier-ci && bun run build" | ||
}, | ||
"prettier": { | ||
"trailingComma": "all" | ||
"ci": "tsc && bun prettier-ci && bun run build && cd dist && publint" | ||
}, | ||
"peerDependencies": { | ||
"react": ">=16", | ||
"vite": "^2 || ^3 || ^4" | ||
"vite": "^5" | ||
}, | ||
"devDependencies": { | ||
"@nabla/tnode": "^0.8.0", | ||
"@types/node": "^18.11.11", | ||
"@types/react": "^18.0.26", | ||
"prettier": "^2.8.1", | ||
"typescript": "^4.9.3", | ||
"vite": "^4.0.0-beta.4" | ||
"@arnaud-barre/tnode": "^0.19.2", | ||
"@types/node": "^18.19.50", | ||
"@types/react": "^18.3.8", | ||
"prettier": "3.0.3", | ||
"publint": "^0.2.11", | ||
"typescript": "^5.6.2", | ||
"vite": "^5.4.7" | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/playground/src/vite.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Vite + React + TS</title> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.tsx"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"name": "playground", | ||
"private": true, | ||
"type": "module", | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "tsc && vite build", | ||
"preview": "vite preview" | ||
}, | ||
"dependencies": { | ||
"react": "^18.3.1", | ||
"react-dom": "^18.3.1" | ||
}, | ||
"devDependencies": { | ||
"@types/react": "^18.3.8", | ||
"@types/react-dom": "^18.3.0", | ||
"@vitejs/plugin-react": "^4.3.1", | ||
"typescript": "^5.6.2", | ||
"vite": "^5.4.7" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { StrictMode } from "react"; | ||
import { createRoot } from "react-dom/client"; | ||
import ReactLogo from "./react.svg"; | ||
import ViteLogo from "./vite.svg"; | ||
import reactLogoSrc from "./react.svg?inline"; | ||
import viteLogoSrc from "./vite.svg?inline"; | ||
|
||
createRoot(document.getElementById("root")!).render( | ||
<StrictMode> | ||
<img src={reactLogoSrc} /> | ||
<img src={viteLogoSrc} /> | ||
<ReactLogo /> | ||
<ViteLogo /> | ||
</StrictMode>, | ||
); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"include": ["**/*.ts", "**/*.tsx"], | ||
"compilerOptions": { | ||
"target": "ES2021", | ||
"useDefineForClassFields": true, | ||
"jsx": "react-jsx", | ||
"module": "ESNext", | ||
"lib": ["ES2021", "DOM", "DOM.Iterable"], | ||
"types": ["vite/client"], | ||
|
||
/* Bundler mode */ | ||
"moduleResolution": "bundler", | ||
"allowImportingTsExtensions": true, | ||
"verbatimModuleSyntax": true, | ||
"noEmit": true, | ||
|
||
/* Linting */ | ||
"skipLibCheck": true, | ||
"strict": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"noFallthroughCasesInSwitch": true, | ||
"useUnknownInCatchVariables": true, | ||
"noPropertyAccessFromIndexSignature": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { defineConfig, type Plugin } from "vite"; | ||
import react from "@vitejs/plugin-react"; | ||
import { svgPlugin } from "../src/index.ts"; | ||
|
||
// https://vitejs.dev/config/ | ||
export default defineConfig({ | ||
plugins: [react(), svgPlugin() as Plugin], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
{ | ||
"include": ["src"], | ||
"include": ["**/*.ts", "**/*.tsx"], | ||
"exclude": ["playground"], | ||
"compilerOptions": { | ||
/* Target node 14 */ | ||
"module": "CommonJS", | ||
"lib": ["ES2020"], | ||
"target": "ES2020", | ||
"skipLibCheck": true, | ||
/* Target node 18 */ | ||
"module": "NodeNext", | ||
"lib": ["ES2021"], | ||
"target": "ES2021", | ||
|
||
/* Transpile with esbuild */ | ||
/* Bundler mode */ | ||
"moduleResolution": "NodeNext", | ||
"allowImportingTsExtensions": true, | ||
"resolveJsonModule": true, | ||
"verbatimModuleSyntax": true, | ||
"noEmit": true, | ||
"isolatedModules": true, | ||
|
||
/* Imports */ | ||
"moduleResolution": "node", // Allow `index` imports | ||
"resolveJsonModule": true, // Allow json import | ||
"forceConsistentCasingInFileNames": true, // Avoid difference in case between file name and import | ||
|
||
/* Linting */ | ||
"skipLibCheck": true, | ||
"strict": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"noFallthroughCasesInSwitch": true, | ||
"useUnknownInCatchVariables": true | ||
"useUnknownInCatchVariables": true, | ||
"noPropertyAccessFromIndexSignature": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.