We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bd1f90b commit 8041b00Copy full SHA for 8041b00
packages/engine/src/modules.ts
@@ -88,7 +88,7 @@ export function createExecutionScope(context: TypeCellContext<any>) {
88
89
export function getModulesFromTypeCellCode(compiledCode: string, scope: any) {
90
// Checks if define([], function) like code is already present
91
- if (!compiledCode.match(/(define\((".*", )?\[.*\], )function/gm)) {
+ if (!compiledCode.match(/^\s+(define\((".*", )?\[.*\], )function/gm)) {
92
// file is not a module (no exports). Create module-like code manually
93
compiledCode = `define([], function() { ${compiledCode}; });`;
94
}
0 commit comments