Skip to content

Commit

Permalink
build(runtime): _plugin-vue_export-helper js file cant not be access …
Browse files Browse the repository at this point in the history
…with Github Pages
  • Loading branch information
roymondchen committed Dec 25, 2024
1 parent a9b4ac0 commit 616a4a5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions runtime/vue3/build.vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ import vueJsx from '@vitejs/plugin-vue-jsx';
// @ts-ignore
import externalGlobals from 'rollup-plugin-external-globals';

const INVALID_CHAR_REGEX = /[\x00-\x1F\x7F<>*#"{}|^[\]`;?:&=+$,]/g;
const DRIVE_LETTER_REGEX = /^[a-z]:/i;

export default defineConfig(({ mode }) => {
if (['value', 'config', 'event', 'ds:value', 'ds:config', 'ds:event'].includes(mode)) {
const capitalToken = mode
Expand Down Expand Up @@ -80,6 +83,14 @@ export default defineConfig(({ mode }) => {
outDir: path.resolve(process.cwd(), `../../playground/public/runtime/vue3/${mode}`),
rollupOptions: {
external: ['vue', 'vue-demi'],
output: {
// https://github.com/rollup/rollup/blob/master/src/utils/sanitizeFileName.ts
sanitizeFileName(name) {
const match = DRIVE_LETTER_REGEX.exec(name);
const driveLetter = match ? match[0] : '';
return driveLetter + name.slice(driveLetter.length).replace(INVALID_CHAR_REGEX, '');
},
},
},
},
};
Expand Down

0 comments on commit 616a4a5

Please sign in to comment.