@netlify/angular-runtime
Advanced tools
Comparing version 2.0.0 to 2.0.1
{ | ||
"name": "@netlify/angular-runtime", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Netlify Angular Runtime - Run Angular seamlessly on Netlify.", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -23,4 +23,11 @@ const { Buffer } = require('node:buffer') | ||
const setUpEdgeFunction = async ({ angularJson, projectName, netlifyConfig, constants, failBuild }) => { | ||
const project = angularJson.projects[projectName] | ||
const getProject = (angularJson) => { | ||
const projectName = angularJson.defaultProject ?? Object.keys(angularJson.projects)[0] | ||
return angularJson.projects[projectName] | ||
} | ||
module.exports.getProject = getProject | ||
const setUpEdgeFunction = async ({ angularJson, constants, failBuild }) => { | ||
const project = getProject(angularJson) | ||
const { | ||
@@ -34,4 +41,2 @@ architect: { build }, | ||
netlifyConfig.build.publish = join(outputDir, 'browser') | ||
const serverDistRoot = join(outputDir, 'server') | ||
@@ -43,3 +48,3 @@ if (!existsSync(serverDistRoot)) { | ||
console.log(`Writing Angular SSR Edge Function for project "${projectName}" ...`) | ||
console.log(`Writing Angular SSR Edge Function ...`) | ||
@@ -107,2 +112,2 @@ const edgeFunctionDir = join(constants.INTERNAL_EDGE_FUNCTIONS_SRC, 'angular-ssr') | ||
module.exports = setUpEdgeFunction | ||
module.exports.setUpEdgeFunction = setUpEdgeFunction |
@@ -5,5 +5,6 @@ const { rm } = require('fs/promises') | ||
const ensureNoCompetingPlugin = require('./helpers/ensureNoCompetingPlugin') | ||
const fixOutputDir = require('./helpers/fixOutputDir') | ||
const getAngularJson = require('./helpers/getAngularJson') | ||
const getAngularRoot = require('./helpers/getAngularRoot') | ||
const setUpEdgeFunction = require('./helpers/setUpEdgeFunction') | ||
const { setUpEdgeFunction } = require('./helpers/setUpEdgeFunction') | ||
const validateAngularVersion = require('./helpers/validateAngularVersion') | ||
@@ -21,3 +22,3 @@ | ||
}, | ||
async onPreBuild({ netlifyConfig, utils }) { | ||
async onPreBuild({ netlifyConfig, utils, constants }) { | ||
const siteRoot = getAngularRoot({ netlifyConfig }) | ||
@@ -33,2 +34,10 @@ isValidAngularProject = await validateAngularVersion(siteRoot) | ||
netlifyConfig.build.command ??= 'npm run build' | ||
await fixOutputDir({ | ||
siteRoot, | ||
failBuild: utils.build.failBuild, | ||
PUBLISH_DIR: constants.PUBLISH_DIR, | ||
IS_LOCAL: constants.IS_LOCAL, | ||
netlifyConfig, | ||
}) | ||
}, | ||
@@ -45,7 +54,4 @@ async onBuild({ utils, netlifyConfig, constants }) { | ||
const projectName = angularJson.defaultProject ?? Object.keys(angularJson.projects)[0] | ||
await setUpEdgeFunction({ | ||
angularJson, | ||
projectName, | ||
constants, | ||
@@ -52,0 +58,0 @@ netlifyConfig, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16426
11
235