File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
packages/cli/templates/webcomponents/igc-ts/projects/_base/files Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 4141 sed -i 's|<base href="[^"]*">|<base href="/${{ github.event.repository.name }}/">|' ./dist/index.html
4242 - name : Update Resource Paths
4343 run : find ./dist -maxdepth 1 -type f ! -name 'sw*.js' ! -name 'workbox*.js' -name '*.js' -exec sed -i -e "s|/src/assets|/${{ github.event.repository.name }}/src/assets|g" -e "s|url('/src/assets|url('/${{ github.event.repository.name }}/src/assets|g" {} +
44- - name : Copy ig-theme.css to dist
45- run : cp ./ig-theme.css ./dist/
4644 - name : Update href Paths for ig-theme.css
4745 run : |
4846 find ./dist -type f -exec sed -i "s|href='../../ig-theme.css'|href='../../${{ github.event.repository.name }}/ig-theme.css'|g" {} +;
Original file line number Diff line number Diff line change 11import { defineConfig } from 'vite' ;
22import { VitePWA } from 'vite-plugin-pwa' ;
33import { viteStaticCopy } from 'vite-plugin-static-copy' ;
4+ import fs from 'fs' ;
5+
6+ const gridMaterialCssPath = [
7+ 'node_modules/igniteui-webcomponents-grids/grids/themes/light/material.css' ,
8+ 'node_modules/@infragistics/igniteui-webcomponents-grids/grids/themes/light/material.css'
9+ ] . find ( fs . existsSync ) || null ;
410
511export default defineConfig ( {
612 build : {
@@ -21,10 +27,21 @@ export default defineConfig({
2127 chunkSizeWarningLimit : 10 * 1024 * 1024 // 10 MB
2228 } ,
2329 plugins : [
30+ {
31+ name : 'replace-grid-material-css-path' ,
32+ apply : 'build' ,
33+ transform ( code , id ) {
34+ if ( gridMaterialCssPath && id . endsWith ( '.js' ) ) {
35+ return code . replace ( gridMaterialCssPath , '../../material.css' ) ;
36+ }
37+ }
38+ } ,
2439 /** Copy static assets */
2540 viteStaticCopy ( {
2641 targets : [
2742 { src : 'src/assets' , dest : 'src' } ,
43+ { src : 'ig-theme.css' , dest : '' } ,
44+ ...( gridMaterialCssPath ? [ { src : gridMaterialCssPath , dest : '' } ] : [ ] )
2845 ] ,
2946 silent : true ,
3047 } ) ,
You can’t perform that action at this time.
0 commit comments