Skip to content

Commit

Permalink
Use vite to build bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
NigelBreslaw committed Oct 16, 2024
1 parent 8fd3f20 commit a4cec52
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 260 deletions.
28 changes: 12 additions & 16 deletions docs/editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,23 @@
"version": "1.0.0",
"type": "module",
"scripts": {
"build": "rollup -c",
"build": "vite build",
"format": "biome format",
"format:fix": "biome format --write",
"lint": "biome lint",
"lint:fix": "biome lint --fix"
},
"devDependencies": {
"rollup": "^3.5.1",
"@rollup/plugin-node-resolve": "^15.0.1"
},
"dependencies": {
"@codemirror/commands": "^6.1.2",
"@codemirror/lang-javascript": "^6.1.1",
"@codemirror/lang-rust": "^6.0.0",
"@codemirror/lang-cpp": "^6.0.0",
"@codemirror/lang-python": "^6.1.0",
"@codemirror/search": "^6.2.3",
"@codemirror/theme-one-dark": "^6.1.0",
"@codemirror/view": "^6.6.0",
"minify": "^9.1.0",
"@uiw/codemirror-theme-dracula": "^4.23.5",
"@babel/runtime": "^7.25.7"
"vite": "5.4.9",
"@babel/runtime": "7.25.7",
"@codemirror/commands": "6.7.0",
"@codemirror/lang-cpp": "6.0.2",
"@codemirror/lang-javascript": "6.2.2",
"@codemirror/lang-python": "6.1.6",
"@codemirror/lang-rust": "6.0.1",
"@codemirror/search": "6.5.6",
"@codemirror/theme-one-dark": "6.1.2",
"@codemirror/view": "6.34.1",
"@uiw/codemirror-theme-dracula": "4.23.5"
}
}
23 changes: 23 additions & 0 deletions docs/editor/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Import Vite libraries
import { defineConfig } from "vite";

// Import resolve from Rollup (you may not need this since Vite has built-in module resolution)
import resolve from "@rollup/plugin-node-resolve";

// Export Vite configuration
export default defineConfig({
build: {
rollupOptions: {
input: "codemirror.js",
output: {
// dir: "../../target/slintdocs/_static/cm6.bundle.js",
format: "iife",
entryFileNames: "cm6.bundle.js",
},
external: [
"https://snapshots.slint.dev/master/wasm-interpreter/slint_wasm_interpreter.js",
],
},
outDir: "../../target/slintdocs/_static",
},
});
Loading

0 comments on commit a4cec52

Please sign in to comment.