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 compile({
sandboxId,
modules,
entry,
externalResources,
dependencies,
hasActions,
isModuleView = false,
template,
}) {
const startTime = Date.now();
try {
clearErrorTransformers();
initializeErrorTransformers();
unmount(manager && manager.webpackHMR);
} catch (e) {
console.error(e);
}
actionsEnabled = hasActions;
handleExternalResources(externalResources);
try {
const { manifest, isNewCombination } = await loadDependencies(dependencies);
if (isNewCombination && !firstLoad) {
// Just reset the whole manager if it's a new combination
manager = null;
}
async function compile({
sandboxId,
modules,
directories,
module,
changedModule,
externalResources,
dependencies,
hasActions,
isModuleView = false,
template,
}) {
try {
clearErrorTransformers();
initializeErrorTransformers();
unmount();
} catch (e) {
console.error(e);
}
actionsEnabled = hasActions;
handleExternalResources(externalResources);
try {
// We convert the modules to a format the manager understands
const managerModules = modules.map(m => ({
path: getModulePath(modules, directories, m.id),
code: m.code,
}));
isModuleView = false,
template,
entry,
showOpenInCodeSandbox = false,
skipEval = false,
hasFileResolver = false,
disableDependencyPreprocessing = false,
}: CompileOptions) {
dispatch({
type: 'start',
});
const startTime = Date.now();
try {
inject();
clearErrorTransformers();
initializeErrorTransformers();
unmount(manager && manager.webpackHMR ? true : hadError);
} catch (e) {
console.error(e);
}
hadError = false;
actionsEnabled = hasActions;
let managerModuleToTranspile = null;
try {
const templateDefinition = getDefinition(template);
const configurations = parseConfigurations(
template,
templateDefinition.configurationFiles,
isModuleView = false,
template,
entry,
showOpenInCodeSandbox = false,
skipEval = false,
hasFileResolver = false,
disableDependencyPreprocessing = false,
}: CompileOptions) {
dispatch({
type: 'start',
});
const startTime = Date.now();
try {
inject();
clearErrorTransformers();
initializeErrorTransformers();
unmount(manager && manager.webpackHMR ? true : hadError);
} catch (e) {
console.error(e);
}
hadError = false;
actionsEnabled = hasActions;
let managerModuleToTranspile = null;
try {
const templateDefinition = getDefinition(template);
const configurations = parseConfigurations(
template,
templateDefinition.configurationFiles,