11/// <reference types="vitest" />
22
33import { qwikVite } from '@builder.io/qwik/optimizer' ;
4- import { dirname , join } from 'path' ;
5- import { qwikNxVite } from 'qwik-nx/plugins' ;
6- import { fileURLToPath } from 'url' ;
4+ import { join } from 'path' ;
75import { defineConfig } from 'vite' ;
86import dts from 'vite-plugin-dts' ;
97import tsconfigPaths from 'vite-tsconfig-paths' ;
108
119export default defineConfig ( {
1210 plugins : [
13- qwikNxVite ( ) ,
14- qwikVite ( ) ,
15- tsconfigPaths ( { root : '../../' } ) ,
11+ qwikVite ( {
12+ vendorRoots : [ join ( __dirname , '../qwik-storefront-ui/src' ) ] ,
13+ } ) ,
14+ tsconfigPaths ( ) ,
1615 dts ( {
17- tsConfigFilePath : join (
18- dirname ( fileURLToPath ( import . meta. url ) ) ,
19- 'tsconfig.lib.json'
20- ) ,
21- // Faster builds by skipping tests. Set this to false to enable type checking.
22- skipDiagnostics : true ,
16+ tsonfigPath : join ( __dirname , 'tsconfig.lib.json' ) ,
2317 } ) ,
2418 ] ,
2519 server : {
@@ -28,19 +22,15 @@ export default defineConfig({
2822 allow : [ '../../' ] ,
2923 } ,
3024 } ,
31-
25+ mode : 'lib' ,
3226 // Configuration for building your library.
3327 // See: https://vitejs.dev/guide/build.html#library-mode
3428 build : {
35- target : 'es2020' ,
36- emptyOutDir : true ,
3729 lib : {
38- entry : './src/index.ts' ,
39-
4030 // Could also be a dictionary or array of multiple entry points.
31+ entry : 'src/index.ts' ,
4132 name : 'qwik-storefront-ui' ,
4233 fileName : ( format ) => `index.qwik.${ format === 'es' ? 'mjs' : 'cjs' } ` ,
43- // fileName: 'index',
4434 // Change this to the formats you want to support.
4535 // Don't forgot to update your package.json as well.
4636 formats : [ 'es' , 'cjs' ] ,
0 commit comments