11/// <reference types="vitest" />
22
33import { qwikVite } from '@builder.io/qwik/optimizer' ;
4- import { join } from 'path' ;
4+ import { dirname , join } from 'path' ;
5+ import { qwikNxVite } from 'qwik-nx/plugins' ;
6+ import { fileURLToPath } from 'url' ;
57import { defineConfig } from 'vite' ;
68import dts from 'vite-plugin-dts' ;
79import tsconfigPaths from 'vite-tsconfig-paths' ;
810
911export default defineConfig ( {
1012 plugins : [
11- qwikVite ( {
12- vendorRoots : [ join ( __dirname , '../qwik-storefront-ui/src' ) ] ,
13- } ) ,
14- tsconfigPaths ( ) ,
13+ qwikNxVite ( ) ,
14+ qwikVite ( ) ,
15+ tsconfigPaths ( { root : '../../' } ) ,
1516 dts ( {
16- tsonfigPath : join ( __dirname , 'tsconfig.lib.json' ) ,
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 ,
1723 } ) ,
1824 ] ,
1925 server : {
@@ -22,15 +28,19 @@ export default defineConfig({
2228 allow : [ '../../' ] ,
2329 } ,
2430 } ,
25- mode : 'lib' ,
31+
2632 // Configuration for building your library.
2733 // See: https://vitejs.dev/guide/build.html#library-mode
2834 build : {
35+ target : 'es2020' ,
36+ emptyOutDir : true ,
2937 lib : {
38+ entry : './src/index.ts' ,
39+
3040 // Could also be a dictionary or array of multiple entry points.
31- entry : 'src/index.ts' ,
3241 name : 'qwik-storefront-ui' ,
3342 fileName : ( format ) => `index.qwik.${ format === 'es' ? 'mjs' : 'cjs' } ` ,
43+ // fileName: 'index',
3444 // Change this to the formats you want to support.
3545 // Don't forgot to update your package.json as well.
3646 formats : [ 'es' , 'cjs' ] ,
0 commit comments