@fastly/compute-js-static-publish
Advanced tools
Comparing version 2.3.0-alpha.4 to 2.3.0-alpha.5
@@ -24,3 +24,3 @@ // This program builds static resources out of the files in the | ||
export async function buildStaticLoader(commandLineValues) { | ||
var _a, _b, _c, _d, _e, _f, _g, _h; | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j; | ||
const { 'suppress-framework-warnings': suppressFrameworkWarnings } = commandLineValues; | ||
@@ -41,8 +41,8 @@ const displayFrameworkWarnings = !suppressFrameworkWarnings; | ||
} | ||
const outputDir = path.resolve(); | ||
const publicDirRoot = path.resolve((_a = config.publicDir) !== null && _a !== void 0 ? _a : './'); | ||
const results = []; | ||
getFiles(results, config.publicDir); | ||
const outputDir = path.resolve(); | ||
const publicDirRoot = path.resolve(config.publicDir); | ||
getFiles(results, publicDirRoot); | ||
console.log(`✔️ Public directory '${publicDirRoot}'.`); | ||
const staticDirs = (_a = config.staticDirs) !== null && _a !== void 0 ? _a : []; | ||
const staticDirs = (_b = config.staticDirs) !== null && _b !== void 0 ? _b : []; | ||
if (staticDirs.length > 0) { | ||
@@ -56,7 +56,7 @@ console.log(`✔️ Using static directories: ${staticDirs.join(', ')}`); | ||
} | ||
const staticRoots = staticDirs.map(dir => path.resolve(config.publicDir, dir)); | ||
const staticRoots = staticDirs.map(dir => path.resolve(publicDirRoot, dir)); | ||
const DEFAULT_EXCLUDE_DIRS = [ | ||
'./node_modules' | ||
]; | ||
const excludeDirs = (_b = config.excludeDirs) !== null && _b !== void 0 ? _b : DEFAULT_EXCLUDE_DIRS; | ||
const excludeDirs = (_c = config.excludeDirs) !== null && _c !== void 0 ? _c : DEFAULT_EXCLUDE_DIRS; | ||
if (excludeDirs.length > 0) { | ||
@@ -70,3 +70,3 @@ console.log(`✔️ Using exclude directories: ${excludeDirs.join(', ')}`); | ||
} | ||
const excludeRoots = excludeDirs.map(dir => path.resolve(config.publicDir, dir)); | ||
const excludeRoots = excludeDirs.map(dir => path.resolve(publicDirRoot, dir)); | ||
// Load defaultContentTypes module | ||
@@ -77,7 +77,7 @@ const __dirname = url.fileURLToPath(new URL('.', import.meta.url)); | ||
// Load content types | ||
const finalContentTypes = defaultContentTypes.mergeContentTypes((_c = config.contentTypes) !== null && _c !== void 0 ? _c : []); | ||
const finalContentTypes = defaultContentTypes.mergeContentTypes((_d = config.contentTypes) !== null && _d !== void 0 ? _d : []); | ||
const DEFAULT_INCLUDE_DIRS = [ | ||
'./.well-known' | ||
]; | ||
const includeDirs = (_d = config.includeDirs) !== null && _d !== void 0 ? _d : DEFAULT_INCLUDE_DIRS; | ||
const includeDirs = (_e = config.includeDirs) !== null && _e !== void 0 ? _e : DEFAULT_INCLUDE_DIRS; | ||
if (includeDirs.length > 0) { | ||
@@ -91,3 +91,3 @@ console.log(`✔️ Using include directories: ${includeDirs.join(', ')}`); | ||
} | ||
const includeRoots = includeDirs.map(dir => path.resolve(config.publicDir, dir)); | ||
const includeRoots = includeDirs.map(dir => path.resolve(publicDirRoot, dir)); | ||
const excludeTest = config.excludeTest; | ||
@@ -97,3 +97,3 @@ const files = results | ||
// Exclude files that come from C@E app dir | ||
if (file.startsWith(outputDir)) { | ||
if (outputDir != publicDirRoot && file.startsWith(outputDir)) { | ||
return false; | ||
@@ -173,3 +173,3 @@ } | ||
fileContents += '};\n'; | ||
let spaFile = (_e = config.spa) !== null && _e !== void 0 ? _e : false; | ||
let spaFile = (_f = config.spa) !== null && _f !== void 0 ? _f : false; | ||
if (spaFile) { | ||
@@ -190,3 +190,3 @@ console.log(`✔️ Application SPA file '${spaFile}'.`); | ||
fileContents += `\nexport const spaFile = ${JSON.stringify(spaFile)};\n`; | ||
let notFoundPageFile = (_f = config.notFoundPage) !== null && _f !== void 0 ? _f : false; | ||
let notFoundPageFile = (_g = config.notFoundPage) !== null && _g !== void 0 ? _g : false; | ||
if (notFoundPageFile) { | ||
@@ -207,5 +207,5 @@ console.log(`✔️ Application 'not found (404)' file '${notFoundPageFile}'.`); | ||
fileContents += `\nexport const notFoundPageFile = ${JSON.stringify(notFoundPageFile)};\n`; | ||
let autoIndex = (_g = config.autoIndex) !== null && _g !== void 0 ? _g : null; | ||
let autoIndex = (_h = config.autoIndex) !== null && _h !== void 0 ? _h : null; | ||
fileContents += `\nexport const autoIndex = ${JSON.stringify(autoIndex)};\n`; | ||
let autoExt = (_h = config.autoExt) !== null && _h !== void 0 ? _h : null; | ||
let autoExt = (_j = config.autoExt) !== null && _j !== void 0 ? _j : null; | ||
fileContents += `\nexport const autoExt = ${JSON.stringify(autoExt)};\n`; | ||
@@ -212,0 +212,0 @@ fileContents += '\nexport const staticAssets = new StaticAssets(assets);\n'; |
{ | ||
"name": "@fastly/compute-js-static-publish", | ||
"type": "module", | ||
"version": "2.3.0-alpha.4", | ||
"version": "2.3.0-alpha.5", | ||
"description": "Static Publisher for Compute@Edge JavaScript", | ||
@@ -6,0 +6,0 @@ "main": "./build/index.js", |
Sorry, the diff of this file is not supported yet
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
58379