Skip to content

Commit

Permalink
maybe polyfill mobile version
Browse files Browse the repository at this point in the history
  • Loading branch information
mProjectsCode committed Apr 1, 2024
1 parent 914f18f commit 7d36d3c
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 0 deletions.
8 changes: 8 additions & 0 deletions automation/build/esbuild.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import esbuild from 'esbuild';
import esbuildSvelte from 'esbuild-svelte';
import sveltePreprocess from 'svelte-preprocess';
import { getBuildBanner } from 'build/buildBanner';
import { nodeModulesPolyfillPlugin } from 'esbuild-plugins-node-modules-polyfill';

const banner = getBuildBanner('Release Build', version => version);

Expand Down Expand Up @@ -48,6 +49,13 @@ const build = await esbuild.build({
return !warning.filename?.includes('node_modules');
},
}),
nodeModulesPolyfillPlugin({
modules: {
fs: true,
path: true,
url: true,
},
}),
],
});

Expand Down
8 changes: 8 additions & 0 deletions automation/build/esbuild.dev.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import esbuildSvelte from 'esbuild-svelte';
import sveltePreprocess from 'svelte-preprocess';
import manifest from '../../manifest.json' assert { type: 'json' };
import { getBuildBanner } from 'build/buildBanner';
import { nodeModulesPolyfillPlugin } from 'esbuild-plugins-node-modules-polyfill';

const banner = getBuildBanner('Dev Build', _ => 'Dev Build');

Expand Down Expand Up @@ -59,6 +60,13 @@ const context = await esbuild.context({
return !warning.filename?.includes('node_modules');
},
}),
nodeModulesPolyfillPlugin({
modules: {
fs: true,
path: true,
url: true,
},
}),
],
});

Expand Down
Binary file modified bun.lockb
Binary file not shown.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"builtin-modules": "^3.3.0",
"esbuild": "^0.20.2",
"esbuild-plugin-copy-watch": "^2.1.0",
"esbuild-plugins-node-modules-polyfill": "^1.6.3",
"esbuild-svelte": "^0.8.0",
"eslint": "^8.57.0",
"eslint-plugin-import": "^2.29.1",
Expand Down
2 changes: 2 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ export default class ShikiPlugin extends Plugin {
}
}),
);

await loadPrism();
}

async loadLanguages(): Promise<void> {
Expand Down

0 comments on commit 7d36d3c

Please sign in to comment.