in common/buildCode.js [309:346]
function buildLegacyMinimalBundleCode(deps, isESM) {
const modules = [];
deps.forEach(function (dep) {
if (dep.endsWith('Renderer') && dep !== 'CanvasRenderer') {
modules.push(
`zrender/lib/${RENDERERS_MAP_REVERSE[dep]}/${RENDERERS_MAP_REVERSE[dep]}`
);
} else if (CHARTS_MAP_REVERSE[dep]) {
modules.push(`echarts/lib/chart/${CHARTS_MAP_REVERSE[dep]}`);
} else if (COMPONENTS_MAP_REVERSE[dep]) {
modules.push(`echarts/lib/component/${COMPONENTS_MAP_REVERSE[dep]}`);
} else if (CHARTS_GL_MAP_REVERSE[dep]) {
modules.push(`echarts-gl/lib/chart/${CHARTS_GL_MAP_REVERSE[dep]}`);
} else if (COMPONENTS_GL_MAP_REVERSE[dep]) {
modules.push(
`echarts-gl/lib/component/${COMPONENTS_GL_MAP_REVERSE[dep]}`
);
} else if (EXTENSIONS_MAP[dep]) {
modules.push(getExtensionDeps([dep], false)[0]);
}
});
return isESM
? `import * as echarts from 'echarts/lib/echarts';
${modules
.map((mod) => {
return `import '${mod}';`;
})
.join('\n')}
`
: `const echarts = require('echarts/lib/echarts');
${modules
.map((mod) => {
return `require('${mod}');`;
})
.join('\n')}
`;
}