Skip to content

Commit a57629d

Browse files
committed
Delete all webpack files and scripts, add vite build for tools and components and all related scripts
1 parent e90e3be commit a57629d

11 files changed

+629
-5582
lines changed

.github/workflows/publish.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
with:
1818
node-version: 20
1919
- name: Install dependencies
20-
run: npm ci
20+
run: npm i
2121
- name: Build
2222
run: npm run build
2323
- name: Testing

components/svgo.config.js

-3
This file was deleted.

components/vite.config.js

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import path from 'node:path';
2+
import url from 'node:url';
3+
import vue from '@vitejs/plugin-vue';
4+
import svg from 'vite-plugin-svgo'
5+
import { defineConfig } from 'vite';
6+
7+
export default defineConfig({
8+
resolve: {
9+
alias: {
10+
'~core': url.fileURLToPath(new URL('./src/core', import.meta.url)),
11+
'~widgets': url.fileURLToPath(new URL('./src/widgets', import.meta.url)),
12+
'~constants': url.fileURLToPath(new URL('./src/constants', import.meta.url)),
13+
'~composables': url.fileURLToPath(new URL('./src/composables', import.meta.url)),
14+
},
15+
},
16+
plugins: [
17+
vue({
18+
customElement: true,
19+
template: {
20+
compilerOptions: {
21+
isCustomElement: (tag) => tag.startsWith('ui-'),
22+
},
23+
},
24+
}),
25+
svg({
26+
plugins: [
27+
{
28+
name: 'preset-default',
29+
params: {
30+
overrides: {
31+
removeViewBox: false,
32+
},
33+
},
34+
},
35+
{
36+
name: 'prefixIds',
37+
}
38+
],
39+
})
40+
],
41+
build: {
42+
emptyOutDir: false,
43+
lib: {
44+
entry: path.resolve(__dirname, 'src/index.js'),
45+
fileName: 'index',
46+
formats: ['es'],
47+
},
48+
rollupOptions: {
49+
output: {
50+
dir: path.resolve(__dirname, '..', 'dist'),
51+
},
52+
external: [
53+
'vue',
54+
/node:\w*/,
55+
],
56+
},
57+
},
58+
})

components/webpack.config.js

-70
This file was deleted.

0 commit comments

Comments
 (0)