Skip to content

Commit

Permalink
WIP for new showcode desktop rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
stevebauman committed May 9, 2024
1 parent 3476dec commit 71478cb
Show file tree
Hide file tree
Showing 4 changed files with 426 additions and 18 deletions.
20 changes: 11 additions & 9 deletions nuxt.config.js
@@ -1,7 +1,5 @@
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');

const path = require('path');

const isDesktop = process.env.IS_DESKTOP === 'true';

module.exports = {
Expand Down Expand Up @@ -72,10 +70,11 @@ module.exports = {
'plugins/shiki',
'plugins/queue',
'plugins/events',
'plugins/ipc-fake',
'plugins/v-tooltip',
'plugins/vue-tailwind',
'plugins/auto-animate',

...(isDesktop ? ['plugins/ipc'] : ['plugins/ipc-fake']),
],

// Auto import components: https://go.nuxtjs.dev/config-components
Expand All @@ -95,12 +94,10 @@ module.exports = {
},
},

router: isDesktop
? {
mode: 'hash',
base: './',
}
: {},
router: isDesktop ? {
mode: 'hash',
base: './',
} : {},

pwa: {
workbox: {
Expand All @@ -121,6 +118,11 @@ module.exports = {
build: {
extend(config) {
config.plugins.push(new MonacoWebpackPlugin());

if (isDesktop) {
config.target = 'electron-renderer';
config.output.hashFunction = "sha256";
}
},

babel: {
Expand Down
10 changes: 5 additions & 5 deletions package.json
Expand Up @@ -8,12 +8,11 @@
},
"license": "MIT",
"scripts": {
"build": "nuxt build",
"dev": "nuxt",
"generate": "nuxt generate",
"shiki:publish": "npx esno ./scripts/publishShikiAssets",
"start": "nuxt start",
"test": "cd browser && php application pest:dusk"
"generate": "nuxt generate",
"test": "cd browser && php application pest:dusk",
"shiki:publish": "npx esno ./scripts/publishShikiAssets"
},
"devDependencies": {
"@formkit/auto-animate": "1.0.0-beta.1",
Expand Down Expand Up @@ -60,7 +59,8 @@
"vue-color": "^2.8.1",
"vue-feather-icons": "^5.1.0",
"vue-tailwind": "^2.5.0",
"vuedraggable": "^2.24.3"
"vuedraggable": "^2.24.3",
"electron": "^30.0.3"
},
"overrides": {
"@formkit/auto-animate": {
Expand Down
4 changes: 2 additions & 2 deletions plugins/shiki.js
Expand Up @@ -7,8 +7,8 @@ import {
} from '@stevebauman/shiki';
import collect from 'collect.js';

setCDN('/shiki/');
setWasm('/shiki/dist/onig.wasm');
setCDN('shiki/');
setWasm('shiki/dist/onig.wasm');

export default async (context, inject) => {
const highlighter = await getHighlighter({
Expand Down

0 comments on commit 71478cb

Please sign in to comment.