Skip to content

Commit

Permalink
Merge pull request #3 from Kong/feat/KHCP-14202_wasm
Browse files Browse the repository at this point in the history
fix: externalise shiki [KHCP-14202]
  • Loading branch information
vaibhavrajsingh2001 authored Nov 21, 2024
2 parents d5af2a8 + db984db commit 0403842
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pnpm dev
### Type-Check

```sh
pnpm type-check
pnpm typecheck
```

### Lint and fix
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"name": "@kong/spec-editor",
"private": true,
"scripts": {
"build": "run-p type-check \"build-only {@}\" --",
"build": "run-p typecheck \"build-only {@}\" --",
"build-only": "vite build",
"commit": "cz",
"dev": "vite",
Expand All @@ -65,7 +65,7 @@
"preview": "vite preview",
"stylelint": "stylelint --allow-empty-input './src/**/*.{css,scss,vue}'",
"stylelint:fix": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,vue}' --fix",
"type-check": "vue-tsc --build --force"
"typecheck": "vue-tsc --build --force"
},
"type": "module",
"version": "0.0.0",
Expand Down
8 changes: 8 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueDevTools from 'vite-plugin-vue-devtools'

// !Important: always externalize `shiki/onig.wasm`
const externalDependencies: string[] = ['shiki/onig.wasm']

// https://vite.dev/config/
export default defineConfig({
base: '/spec-editor',
Expand All @@ -16,6 +19,11 @@ export default defineConfig({
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
build: {
rollupOptions: {
external: externalDependencies,
},
},
css: {
devSourcemap: true,
preprocessorOptions: {
Expand Down

0 comments on commit 0403842

Please sign in to comment.