Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default function register(opts = DEFAULT_CLI_OPTS) {
// Replace old hook, as this one likely contains options.
if (hooks) {
for (let extension in hooks) {
hooks[extension]();
}
}
let parcel = new Parcel({
entries: [path.join(process.cwd(), 'index.js')],
cliOpts: opts
});
let environment = new Environment({
context: 'node',
engines: {
node: process.versions.node
}
});
syncPromise(parcel.init());
let isProcessing = false;
// As Parcel is pretty much fully asynchronous, create an async function and wrap it in a syncPromise later...
async function fileProcessor(code, filename) {
if (isProcessing) {
return code;
}