Skip to content

Commit

Permalink
Merge pull request #78 from cloudblue/LITE-29720-migrate-from-webpack…
Browse files Browse the repository at this point in the history
…-to-vite

Lite 29720 migrate from webpack to vite
  • Loading branch information
arnaugiralt authored Apr 8, 2024
2 parents ed1b25c + b190889 commit 89d8f13
Show file tree
Hide file tree
Showing 11 changed files with 643 additions and 4,992 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
with:
node-version: 20
- name: Install dependencies
run: npm ci
run: npm i
- name: Build
run: npm run build
- name: Testing
Expand Down
3 changes: 0 additions & 3 deletions components/svgo.config.js

This file was deleted.

57 changes: 57 additions & 0 deletions components/vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import path from 'node:path';
import url from 'node:url';
import vue from '@vitejs/plugin-vue';
import svg from 'vite-plugin-svgo'
import { defineConfig } from 'vite';

export default defineConfig({
resolve: {
alias: {
'~core': url.fileURLToPath(new URL('./src/core', import.meta.url)),
'~widgets': url.fileURLToPath(new URL('./src/widgets', import.meta.url)),
'~constants': url.fileURLToPath(new URL('./src/constants', import.meta.url)),
},
},
plugins: [
vue({
customElement: true,
template: {
compilerOptions: {
isCustomElement: (tag) => tag.startsWith('ui-'),
},
},
}),
svg({
plugins: [
{
name: 'preset-default',
params: {
overrides: {
removeViewBox: false,
},
},
},
{
name: 'prefixIds',
}
],
})
],
build: {
emptyOutDir: false,
lib: {
entry: path.resolve(__dirname, 'src/index.js'),
fileName: 'index',
formats: ['es'],
},
rollupOptions: {
output: {
dir: path.resolve(__dirname, '..', 'dist'),
},
external: [
'vue',
/node:\w*/,
],
},
},
})
69 changes: 0 additions & 69 deletions components/webpack.config.js

This file was deleted.

Loading

0 comments on commit 89d8f13

Please sign in to comment.