Skip to content

Commit 2721457

Browse files
committed
Add vite library mode build
1 parent 3b5527b commit 2721457

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"wireit": "^0.14.12"
5959
},
6060
"exports": {
61-
".": "./dist/src/index.js",
61+
".": "./dist/index.js",
6262
"./*": "./dist/src/elements/*.js",
6363
"./labs/*": "./dist/src/labs/*.js"
6464
},
@@ -73,7 +73,7 @@
7373
],
7474
"wireit": {
7575
"build": {
76-
"command": "tsc --build --pretty && tsc-alias && rsync -zarvm --prune-empty-dirs --include \"*/\" --include \"*.svg\" --exclude=\"*\" src dist",
76+
"command": "tsc --build --pretty && tsc-alias && rsync -zarvm --prune-empty-dirs --include \"*/\" --include \"*.svg\" --exclude=\"*\" src dist && vite build --emptyOutDir=false",
7777
"dependencies": [
7878
"circular"
7979
],

src/elements/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
export * from './ia-status-indicator/ia-status-indicator';
12
export * from './ia-button/ia-button';

vite.config.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,18 @@ export default defineConfig({
1111
'@demo': path.resolve(__dirname, './demo'),
1212
},
1313
},
14+
build: {
15+
lib: {
16+
entry: path.resolve(__dirname, 'src/elements/index'),
17+
name: 'Elements',
18+
formats: ['es'],
19+
fileName: 'index',
20+
},
21+
rollupOptions: {
22+
// Externalize deps that shouldn't be bundled
23+
external: ['lit']
24+
},
25+
},
1426
test: {
1527
browser: {
1628
enabled: true,

0 commit comments

Comments
 (0)