Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
type: ChunkType.AST,
fileType: FileType.JS,
name: componentChunkName,
meta: {
nodesLookup,
dynamicRefPrefix: jsxOptions.dynamicReferencePrefixMap,
},
content: pureComponent,
linkAfter: [importChunkName],
})
structure.chunks.push({
type: ChunkType.AST,
fileType: FileType.JS,
name: exportChunkName,
content: ASTBuilders.createDefaultExport(componentName),
linkAfter: [componentChunkName],
})
return structure
}
type: ChunkType.AST,
fileType: FileType.JS,
name: componentChunkName,
meta: {
nodesLookup,
dynamicRefPrefix: jsxOptions.dynamicReferencePrefixMap,
},
content: preactComponent,
linkAfter: [importChunkName],
})
structure.chunks.push({
type: ChunkType.AST,
fileType: FileType.JS,
name: exportChunkName,
content: ASTBuilders.createDefaultExport(componentName),
linkAfter: [componentChunkName],
})
return structure
}
})
const rootRouterTag = createRouteRouterTag(flavor, routeJSXDefinitions)
const pureComponent = ASTBuilders.createFunctionalComponent(uidl.name, rootRouterTag)
structure.chunks.push({
type: ChunkType.AST,
fileType: FileType.JS,
name: componentChunkName,
content: pureComponent,
linkAfter: [importChunkName],
})
if (flavor === 'preact') {
const exportJSXApp = ASTBuilders.createDefaultExport('App')
structure.chunks.push({
type: ChunkType.AST,
fileType: FileType.JS,
name: domRenderChunkName,
content: exportJSXApp,
linkAfter: [componentChunkName],
})
} else {
const reactDomBind = ASTBuilders.createFunctionCall('ReactDOM.render', [
ASTBuilders.createSelfClosingJSXTag(uidl.name),
ASTBuilders.createFunctionCall('document.getElementById', ['app']),
])
structure.chunks.push({
type: ChunkType.AST,