An isolated development space with integrated fuzz testing for your components. See them individually, explore them in different states and quickly and confidently develop them.
const assets = this.options.files;
if (assets.length > 0) {
setTimeout(() => {
renderToClient({
// TODO the name is used in the iframe & playground list
// best to pass it in there instead of hardcoding it
name: 'react',
frontendData: new Promise((resolve, reject) => {
readMultipleFiles(assets, (err, contents) => {
if (err) {
reject(err);
}
const scripts = [];
const styles = [];
// Depending on the asset type that was passed add them to a script
// or style tag
assets.forEach((assetFilename, index) => {
switch (assetFilename.substr(-3)) {
case '.js': scripts.push(contents[index]); break;
case 'css': styles.push(contents[index]); break;
default: break;
}
});
resolve({ options, files: { scripts, styles } });
});
}),
frontendPlugin: `${require.resolve('./frontend/index.js')}`,
});
}, 5);
}