Skip to content

Commit

Permalink
fix deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
VladimirDegt committed Dec 25, 2023
1 parent 43d8de1 commit 2e4bb13
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 22 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,16 @@ jobs:
npm install
npm run build
- name: Rename files
run: |
find ./ -type f -name "_commonjsHelpers-a1841df3.js" -exec bash -c 'mv "$0" "${0%/_commonjsHelpers-a1841df3.js}/commonjsHelpers-a1841df3.js"' {} \;
- name: Fix imports
run: |
find ./ -type f -exec sed -i 's/_commonjsHelpers-a1841df3.js/commonjsHelpers-a1841df3.js/g' {} \;
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@4.1.0
with:
branch: gh-pages
folder: dist
folder: dist
48 changes: 27 additions & 21 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,33 @@ import injectHTML from 'vite-plugin-html-inject';
import FullReload from 'vite-plugin-full-reload';

export default defineConfig(({ command }) => {
return {
define: {
[command === 'serve' ? 'global' : '_global']: {},
},
root: 'src',
build: {
sourcemap: true,

rollupOptions: {
input: glob.sync('./src/*.html'),
output: {
manualChunks(id) {
if (id.includes('node_modules')) {
return 'vendor';
}
},
entryFileNames: 'commonHelpers.js',
if (command === 'serve') {
return {
define: {
global: {},
},
root: 'src',
build: {
rollupOptions: {
input: glob.sync('./src/*.html'),
},
outDir: '../dist',
},
plugins: [injectHTML(), FullReload(['./src/**/**.html'])],
};
} else {
return {
define: {
_global: {},
},
root: 'src',
build: {
rollupOptions: {
input: glob.sync('./src/*.html'),
},
outDir: '../dist',
},
outDir: '../dist',
},
plugins: [injectHTML(), FullReload(['./src/**/**.html'])],
};
plugins: [injectHTML(), FullReload(['./src/**/**.html'])],
};
}
});

0 comments on commit 2e4bb13

Please sign in to comment.