Skip to content

Commit 4fa2192

Browse files
Hristo HristovHristo Hristov
authored andcommitted
fix: add missing static css files
1 parent 1846e1a commit 4fa2192

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

packages/cli/templates/webcomponents/igc-ts/projects/_base/files/__dot__github/workflows/github-pages.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ jobs:
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" {} +;

packages/cli/templates/webcomponents/igc-ts/projects/_base/files/vite.config.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
import { defineConfig } from 'vite';
22
import { VitePWA } from 'vite-plugin-pwa';
33
import { 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

511
export 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
}),

0 commit comments

Comments
 (0)