Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function buildPreview(outputDir, assets) {
const configs = createCompatibilityConfig({
input: 'noop',
extensions: [...DEFAULT_EXTENSIONS, 'mdx'],
plugins: { indexHTML: false },
});
configs[0].output.dir = path.join(outputDir, 'legacy');
configs[1].output.dir = outputDir;
configs[0].plugins.unshift(
indexHTML({
indexFilename: 'iframe.html',
indexHTMLString: assets.iframeHTML,
multiBuild: true,
legacy: true,
polyfills: {
dynamicImport: true,