Skip to content

Commit 65a097a

Browse files
upgrade to vite2
1 parent 04bb79a commit 65a097a

File tree

3 files changed

+232
-1989
lines changed

3 files changed

+232
-1989
lines changed

package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,23 @@
1919
"*.!(lock|gitignore)": "prettier -w"
2020
},
2121
"scripts": {
22-
"start": "svite",
23-
"build": "svite build --base '/web-program-gallery/' && rollup -c",
22+
"start": "vite",
23+
"build": "vite build --base '/web-program-gallery/' && rollup -c",
2424
"programs": "scripts/qoala-convert.js convert -o src/data 'contrib/program-examples/*.json'",
2525
"pretty": "prettier -w ."
2626
},
2727
"dependencies": {
2828
"fuse.js": "^6.4.6",
29+
"glob": "^7.1.7",
2930
"svelte": "^3.32.0",
30-
"node-glob": "^1.2.0",
31+
"svite": "^0.9.0-6",
3132
"yargs": "^16.2.0"
3233
},
3334
"devDependencies": {
3435
"@rollup/plugin-json": "^4.1.0",
3536
"@rollup/plugin-node-resolve": "^11.1.0",
3637
"@rollup/plugin-run": "^2.0.2",
38+
"@sveltejs/vite-plugin-svelte": "^1.0.0-next.10",
3739
"husky": "^4.3.8",
3840
"lint-staged": "^10.5.4",
3941
"prettier": "^2.2.1",
@@ -43,6 +45,6 @@
4345
"rollup-plugin-svelte": "^7.1.0",
4446
"svelte-hmr": "^0.11.6",
4547
"svelte-preprocess": "^4.6.3",
46-
"svite": "^0.8.1"
48+
"vite": "^2.3.3"
4749
}
4850
}

vite.config.js

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
1-
module.exports = {
2-
optimizeDeps: {
3-
exclude: ["yargs", "node-glob"],
4-
},
5-
};
1+
const svelte = require("@sveltejs/vite-plugin-svelte");
2+
const { defineConfig } = require("vite");
3+
4+
module.exports = defineConfig(({ command, mode }) => {
5+
const isProduction = mode === "production";
6+
7+
return {
8+
optimizeDeps: {
9+
exclude: ["yargs", "glob"],
10+
},
11+
plugins: [svelte({})],
12+
build: {
13+
minify: isProduction,
14+
},
15+
};
16+
});

0 commit comments

Comments
 (0)