File tree Expand file tree Collapse file tree 3 files changed +12
-24
lines changed
libs/@hashintel/petrinaut Expand file tree Collapse file tree 3 files changed +12
-24
lines changed Original file line number Diff line number Diff line change @@ -216,20 +216,6 @@ export default withSentryConfig(
216216 // eslint-disable-next-line no-param-reassign
217217 webpackConfig . resolve . alias . canvas = false ;
218218
219- if ( ! isServer ) {
220- // Stub Node.js built-ins for browser — needed by `typescript` (used by
221- // @hashintel /petrinaut's in-browser language service)
222- // eslint-disable-next-line no-param-reassign
223- webpackConfig . resolve . fallback = {
224- ...webpackConfig . resolve . fallback ,
225- module : false ,
226- fs : false ,
227- path : false ,
228- os : false ,
229- perf_hooks : false ,
230- } ;
231- }
232-
233219 webpackConfig . plugins . push (
234220 new DefinePlugin ( {
235221 __SENTRY_DEBUG__ : false ,
Original file line number Diff line number Diff line change @@ -24,17 +24,13 @@ export const buildCspHeader = (nonce: string): string => {
2424 "https://apis.google.com" ,
2525 // Vercel toolbar / live preview widget
2626 "https://vercel.live" ,
27- // Monaco Editor loaded from CDN by @monaco -editor/react (used by petrinaut)
28- "https://cdn.jsdelivr.net" ,
2927 ] ,
3028
3129 "style-src" : [
3230 "'self'" ,
3331 // Required for Emotion/MUI CSS-in-JS inline style injection.
3432 // @todo Use nonce-based approach via Emotion's cache `nonce` option.
3533 "'unsafe-inline'" ,
36- // Monaco Editor stylesheet loaded from CDN by @monaco -editor/react (used by petrinaut)
37- "https://cdn.jsdelivr.net" ,
3834 ] ,
3935
4036 "img-src" : [
@@ -49,11 +45,7 @@ export const buildCspHeader = (nonce: string): string => {
4945 ...( process . env . NODE_ENV === "development" ? [ "http:" ] : [ ] ) ,
5046 ] ,
5147
52- "font-src" : [
53- "'self'" ,
54- // Monaco Editor CSS embeds the Codicon icon font as an inline base64 data URI
55- "data:" ,
56- ] ,
48+ "font-src" : [ "'self'" ] ,
5749
5850 "connect-src" : [
5951 "'self'" ,
Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ export default defineConfig({
2121 "react" ,
2222 "react-dom" ,
2323 "reactflow" ,
24- "typescript" ,
2524 "monaco-editor" ,
2625 "@babel/standalone" ,
2726 ] ,
@@ -48,7 +47,17 @@ export default defineConfig({
4847 // This causes crashes in Web Workers, since `window` is not defined there.
4948 // To prevent this, we do this resolution on our side.
5049 "typeof window" : '"undefined"' ,
50+ // TypeScript's internals reference process, process.versions.pnp, etc.
51+ "typeof process" : "'undefined'" ,
52+ "typeof process.versions.pnp" : "'undefined'" ,
5153 } ) ,
54+ // Separate replacePlugin for call-expression replacements:
55+ // 1. Empty end delimiter because \b can't match after `)` (non-word → non-word).
56+ // 2. Negative lookbehind skips the function definition (`function isNodeLikeSystem`).
57+ replacePlugin (
58+ { "isNodeLikeSystem()" : "false" } ,
59+ { delimiters : [ "(?<!function )\\b" , "" ] } ,
60+ ) ,
5261 ] ,
5362 } ,
5463
@@ -59,6 +68,7 @@ export default defineConfig({
5968 "react/compiler-runtime" ,
6069 "react/jsx-runtime" ,
6170 "react/jsx-dev-runtime" ,
71+ "typescript" ,
6272 ] ,
6373 } ) ,
6474
You can’t perform that action at this time.
0 commit comments