File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed
packages/instrument-bundler/src Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -7,11 +7,10 @@ import type { BundleOptions } from './schemas.js';
77import type { BuildOutput } from './types.js' ;
88
99const GLOBAL_PROXY_SHIM = `
10- let __ODC_BUNDLER_ERROR_CONTEXT;
1110 const __createProxy = (name) => {
1211 const formatErrorMessage = (method, propertyName, targetName) => {
13- const contextName = __ODC_BUNDLER_ERROR_CONTEXT ?? 'UNKNOWN'
14- return "Cannot " + method + " property '" + propertyName + "' of object '" + targetName + "' in global scope of context '" + contextName + "'"
12+ const contextName = globalThis. __ODC_BUNDLER_ERROR_CONTEXT ?? 'UNKNOWN'
13+ return "Cannot " + method + " property '" + propertyName + "' of object '" + targetName + "' in global scope of file '" + contextName + "'"
1514 }
1615 return new Proxy({ name }, {
1716 get(target, property) {
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ export const plugin = (options: { inputs: BundlerInput[] }): Plugin => {
4747 let contents : typeof input . content ;
4848 const loader = inferLoader ( input . name ) ;
4949 if ( loader === 'js' || loader === 'jsx' || loader === 'ts' || loader == 'tsx' ) {
50- contents = [ `__ODC_BUNDLER_ERROR_CONTEXT = "${ input . name } ";` , input . content as string ] . join ( '\n' ) ;
50+ contents = [ `globalThis. __ODC_BUNDLER_ERROR_CONTEXT = "${ input . name } ";` , input . content as string ] . join ( '\n' ) ;
5151 } else {
5252 contents = input . content ;
5353 }
You can’t perform that action at this time.
0 commit comments