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 bundle(opts: *) {
const directory = process.cwd();
// Need to add @babel/register to support ES2015+ in config file.
require('../babelRegister');
const configPath = getProjectConfigPath(directory, opts.config);
const projectConfig = getProjectConfig(configPath);
const config = getWebpackConfig(
new Runtime(),
{
platform: opts.platform,
root: directory,
dev: opts.dev,
minify: opts.minify,
bundle: true,
},
projectConfig
);
if (opts.assetsDest) {
config.output.path = path.isAbsolute(opts.assetsDest)
? opts.assetsDest
: path.join(directory, opts.assetsDest);