Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const outputOptions = {
format,
file: entrypointPath.replace(/\/es\//, `/${directory}/`),
};
if (format === 'umd') {
outputOptions.name = 'CarbonIconsVue';
}
await bundle.write(outputOptions);
})
);
reporter.info('Generating Storybook stories...');
await fs.remove(STORYBOOK_DIR);
await fs.ensureDir(STORYBOOK_DIR);
await Promise.all(
meta.map(info => {
const { moduleName } = info;
const outputPath = path.join(STORYBOOK_DIR, `${moduleName}-story.js`);
return fs.writeFile(outputPath, createIconStory(info));
})
);
reporter.success('Done! 🎉');
}
async function build() {
const modules = meta.map(icon => {
const { source } = createIconComponent(icon.moduleName, icon.descriptor);
return {
moduleName: icon.moduleName,
filepath: icon.outputOptions.file.replace(/^es\//g, '').slice(0, -3),
source,
};
});
const entrypoint = `export const CarbonIconsVue = {
install(Vue, options) {
const { components } = options;
Object.keys(components).forEach(key => {
Vue.component(key, components[key]);
});
},
}`;