Skip to content

Commit 6303bf2

Browse files
committed
Replace webpack with vite
1 parent 7c770dd commit 6303bf2

File tree

5 files changed

+64
-42
lines changed

5 files changed

+64
-42
lines changed

wsi_superpixel_guided_labeling/web_client/package.json

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,44 +3,34 @@
33
"version": "0.1.0",
44
"private": true,
55
"description": "Perform active learning with superpixel classification.",
6-
"homepage": "https://github.com/DigitalSlideArchive/wsi_superpixel_guided_labeling",
6+
"homepage": "https://github.com/DigitalSlideArchive/wsi-superpixel-guided-labeling",
77
"license": "Apache-2.0",
8-
"peerDependencies": {
9-
"@girder/core": "*",
10-
"@girder/histomicsui": "*"
11-
},
12-
"girderPlugin": {
13-
"name": "wsi_superpixel_guided_labeling",
14-
"main": "./main.js",
15-
"dependencies": [
16-
"histomicsui",
17-
"large_image",
18-
"large_image_annotation",
19-
"slicer_cli_web"
20-
],
21-
"webpack": "webpack.helper"
22-
},
8+
"main": "./main.js",
9+
"type": "module",
2310
"scripts": {
2411
"lint": "eslint . && pug-lint . && stylint",
25-
"format": "eslint --cache --fix ."
12+
"format": "eslint --cache --fix .",
13+
"dev": "vite",
14+
"build": "vite build"
2615
},
2716
"dependencies": {
17+
"@girder/core": "^5.0.0-beta.2",
18+
"@girder/histomicsui": "file:../../../HistomicsUI/histomicsui/web_client",
2819
"@vue/compiler-sfc": "^3.2.33",
2920
"backbone.localstorage": "^2.0.2",
3021
"bootstrap-submenu": "^2.0.4",
31-
"copy-webpack-plugin": "^4.5.2",
3222
"petite-vue": "^0.4.1",
3323
"sinon": "^2.1.0",
3424
"tinycolor2": "^1.4.1",
3525
"url-search-params-polyfill": "^8.1.1",
36-
"vue": "~2.6.14",
37-
"vue-template-compiler": "~2.6.14",
38-
"vue-loader": "~15.9.8",
39-
"webpack": "^3"
26+
"vue": "^2.7.16",
27+
"vue-template-compiler": "~2.6.14"
4028
},
4129
"devDependencies": {
4230
"@girder/eslint-config": "*",
4331
"@girder/pug-lint-config": "*",
32+
"@types/node": "^20.11.24",
33+
"@vitejs/plugin-vue2": "^2.2.0",
4434
"eslint": "^8.20.0",
4535
"eslint-config-semistandard": "17.0.0",
4636
"eslint-config-standard": "^17.0.0",
@@ -49,8 +39,11 @@
4939
"eslint-plugin-n": "^15.2.4",
5040
"eslint-plugin-promise": "^6.0.0",
5141
"eslint-plugin-vue": "^9.10.0",
42+
"pug": "^3.0.3",
5243
"pug-lint": "^2",
53-
"stylint": "^2"
44+
"stylint": "^2",
45+
"stylus": "^0.64.0",
46+
"vite": "^5.0.0"
5447
},
5548
"eslintConfig": {
5649
"extends": [
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"include": ["./vite-env.d.ts", "./**/*"],
3+
"exclude": ["./dist/**/*"],
4+
"compilerOptions": {
5+
"allowJs": true,
6+
"outDir": "./dist",
7+
}
8+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/// <reference types="vite/client" />
2+
import { type Girder } from '@girder/core';
3+
4+
declare global {
5+
const girder: Girder;
6+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import { resolve } from 'path';
2+
3+
import { defineConfig } from 'vite';
4+
import { compileClient } from 'pug';
5+
import vue from '@vitejs/plugin-vue2';
6+
7+
function pugPlugin() {
8+
return {
9+
name: 'pug',
10+
transform(src: string, id: string) {
11+
if (id.endsWith('.pug')) {
12+
return {
13+
code: `${compileClient(src, {filename: id})}\nexport default template`,
14+
map: null,
15+
};
16+
}
17+
},
18+
};
19+
}
20+
21+
export default defineConfig({
22+
plugins: [
23+
pugPlugin(),
24+
vue()
25+
],
26+
build: {
27+
sourcemap: !process.env.SKIP_SOURCE_MAPS,
28+
lib: {
29+
entry: resolve(__dirname, 'main.js'),
30+
name: 'GirderPluginWSISuperpixelGuidedLabeling',
31+
fileName: 'girder-plugin-wsi-superpixel-guided-labeling',
32+
},
33+
},
34+
});

wsi_superpixel_guided_labeling/web_client/webpack.helper.js

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)