@fastly/compute-js-static-publish
Advanced tools
Comparing version 2.3.0 to 2.4.0-alpha.0
@@ -113,3 +113,3 @@ // This program builds static resources out of the files in the | ||
const knownAssets = {}; | ||
let fileContents = 'import { Buffer } from "buffer";\n'; | ||
let fileContents = ''; | ||
for (const [index, file] of files.entries()) { | ||
@@ -137,2 +137,14 @@ const relativeFilePath = path.relative('./src', file); | ||
fileContents += 'import { StaticAssets } from "@fastly/compute-js-static-publish";\n'; | ||
fileContents += ` | ||
function fromBase64(data) { | ||
const raw = atob(data); | ||
const rawLength = raw.length; | ||
const array = new ArrayBuffer(rawLength); | ||
const view = new Uint8Array(array); | ||
for (let i = 0; i < rawLength; i++) { | ||
view[i] = raw.charCodeAt(i); | ||
} | ||
return array; | ||
} | ||
`; | ||
fileContents += `\nexport const assets = {\n`; | ||
@@ -153,3 +165,3 @@ for (const [index, file] of files.entries()) { | ||
if (contentDef == null || contentDef.binary) { | ||
content = 'Buffer.from(file' + index + ', "base64")'; | ||
content = 'fromBase64(file' + index + ')'; | ||
} | ||
@@ -156,0 +168,0 @@ else { |
@@ -176,8 +176,8 @@ // This program creates a Compute@Edge JavaScript application | ||
"@fastly/expressly": "^1.0.0-alpha.7", | ||
"@fastly/js-compute": "^0.5.3", | ||
"buffer": "^6.0.3", | ||
"core-js": "^3.19.1", | ||
"webpack": "^5.64.0", | ||
"webpack-cli": "^4.9.1" | ||
"webpack": "^5.75.0", | ||
"webpack-cli": "^5.0.0" | ||
}, | ||
"dependencies": { | ||
"@fastly/js-compute": "^0.5.12" | ||
}, | ||
"engines": { | ||
@@ -184,0 +184,0 @@ "node": ">=16.0.0" |
@@ -1,2 +0,1 @@ | ||
/// <reference types="node" resolution-mode="require"/> | ||
declare type TestFn = (name: string) => boolean; | ||
@@ -18,3 +17,3 @@ export declare type ContentTypeDef = { | ||
contentType: string; | ||
content: Buffer | string; | ||
content: ArrayBuffer | string; | ||
module: unknown | null; | ||
@@ -21,0 +20,0 @@ isStatic: boolean; |
{ | ||
"name": "@fastly/compute-js-static-publish", | ||
"type": "module", | ||
"version": "2.3.0", | ||
"version": "2.4.0-alpha.0", | ||
"description": "Static Publisher for Compute@Edge JavaScript", | ||
@@ -33,3 +33,3 @@ "main": "./build/index.js", | ||
"dependencies": { | ||
"@fastly/js-compute": "^0.5.4", | ||
"@fastly/js-compute": "^0.5.12", | ||
"command-line-args": "^5.2.1" | ||
@@ -36,0 +36,0 @@ }, |
@@ -52,11 +52,3 @@ const path = require("path"); | ||
// or core nodejs modules needed for your application. | ||
new ProvidePlugin({ | ||
Buffer: [ "buffer", "Buffer" ], | ||
}), | ||
], | ||
resolve: { | ||
fallback: { | ||
"buffer": require.resolve("buffer/"), | ||
}, | ||
}, | ||
}; |
Sorry, the diff of this file is not supported yet
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
58389
1119
2
Updated@fastly/js-compute@^0.5.12