Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const possibleEntries = templateDefinition.getEntries(configurations);
const foundMain = isModuleView
? entry
: possibleEntries.find(p => Boolean(modules[p]));
if (!foundMain) {
throw new Error(
`Could not find entry file: ${
possibleEntries[0]
}. You can specify one in package.json by defining a \`main\` property.`
);
}
const main = absolute(foundMain);
managerModuleToTranspile = modules[main];
// TODO: make this a separate lifecycle
// await manager.preset.setup(manager);
dispatch({ type: 'status', status: 'transpiling' });
manager.setStage('transpilation');
await manager.verifyTreeTranspiled();
await manager.transpileModules(managerModuleToTranspile);
debug(`Transpilation time ${Date.now() - t}ms`);
dispatch({ type: 'status', status: 'evaluating' });
manager.setStage('evaluation');
const possibleEntries = templateDefinition.getEntries(configurations);
const foundMain = isModuleView
? entry
: possibleEntries.find(p => !!modules[p]);
if (!foundMain) {
throw new Error(
`Could not find entry file: ${
possibleEntries[0]
}. You can specify one in package.json by defining a \`main\` property.`
);
}
const main = absolute(foundMain);
managerModuleToTranspile = modules[main];
// TODO: make this a separate lifecycle
// await manager.preset.setup(manager);
dispatch({ type: 'status', status: 'transpiling' });
manager.setStage('transpilation');
await manager.verifyTreeTranspiled();
await manager.transpileModules(managerModuleToTranspile);
debug(`Transpilation time ${Date.now() - t}ms`);
dispatch({ type: 'status', status: 'evaluating' });
manager.setStage('evaluation');
async (err, resolvedPath) => {
if (err) {
if (/^\w/.test(p)) {
r(resolveSass(fs, '.' + absolute(p), path));
}
reject(err);
} else {
const foundPath = await getExistingPath(fs, resolvedPath);
r(foundPath);
}
}
);
async (err, resolvedPath) => {
if (err) {
if (/^\w/.test(p)) {
r(resolveSass(fs, '.' + absolute(p), path));
}
reject(err);
} else {
const foundPath = await getExistingPath(fs, resolvedPath);
r(foundPath);
}
}
);
async function addAngularCLIPolyfills(manager) {
const { parsed } = manager.configurations['angular-cli'];
if (parsed.apps && parsed.apps[0]) {
const app = parsed.apps[0];
if (app.root && app.polyfills) {
const polyfillLocation = absolute(join(app.root, app.polyfills));
const polyfills = manager.resolveModule(polyfillLocation, '/');
await manager.transpileModules(polyfills);
manager.evaluateModule(polyfills);
}
}
}
async function addAngularJSONPolyfills(manager) {
const { parsed } = manager.configurations['angular-config'];
const { defaultProject } = parsed;
const project = parsed.projects[defaultProject];
const { build } = project.architect;
if (build.options) {
if (project.root && build.options.polyfill) {
const polyfillLocation = absolute(
join(project.root, build.options.polyfill)
);
const polyfills = manager.resolveModule(polyfillLocation, '/');
await manager.transpileModules(polyfills);
manager.evaluateModule(polyfills);
}
}
}