File tree Expand file tree Collapse file tree 4 files changed +27
-38
lines changed Expand file tree Collapse file tree 4 files changed +27
-38
lines changed Original file line number Diff line number Diff line change 12
12
- name : Setup Node
13
13
uses : actions/setup-node@v3
14
14
with :
15
- node-version : ' 18 '
15
+ node-version : ' 20.11 '
16
16
- name : Setup Fastly CLI
17
17
uses : fastly/compute-actions/setup@v5
18
18
- name : Install Dependencies
Original file line number Diff line number Diff line change 1
1
{
2
- "author" : " oss@fastly.com" ,
3
- "bugs" : {
4
- "url" : " https://github.com/fastly/compute-starter-kit-javascript-queue/issues"
5
- },
2
+ "type" : " module" ,
3
+ "private" : true ,
6
4
"dependencies" : {
7
- "@fastly/js-compute" : " ^3.0.0 " ,
5
+ "@fastly/js-compute" : " ^3.33.2 " ,
8
6
"@upstash/redis" : " ^1.23.4" ,
9
7
"jws" : " ^4.0.0"
10
8
},
11
9
"devDependencies" : {
12
- "@fastly/cli" : " ^10.14 .0" ,
10
+ "@fastly/cli" : " ^11.0 .0" ,
13
11
"buffer" : " ^6.0.3" ,
14
12
"node-polyfill-webpack-plugin" : " ^2.0.1" ,
15
- "webpack" : " ^5.89 .0" ,
13
+ "webpack" : " ^5.98 .0" ,
16
14
"webpack-cli" : " ^5.1.4"
17
15
},
18
- "engines" : {
19
- "node" : " ^18.0.0"
20
- },
21
- "homepage" : " https://developer.fastly.com/solutions/starters/compute-starter-kit-javascript-queue" ,
22
- "license" : " MIT" ,
23
- "main" : " src/index.js" ,
24
- "name" : " compute-starter-kit-javascript-queue" ,
25
- "repository" : {
26
- "type" : " git" ,
27
- "url" : " git+https://github.com/fastly/compute-starter-kit-javascript-queue.git"
28
- },
29
16
"scripts" : {
30
17
"prebuild" : " webpack" ,
31
- "build" : " js-compute-runtime bin/index.js bin/main.wasm" ,
18
+ "build" : " js-compute-runtime bin/index.cjs bin/main.wasm" ,
32
19
"start" : " fastly compute serve" ,
33
20
"deploy" : " fastly compute publish"
34
21
},
35
- "version" : " 1.0.0-pre"
22
+ "engines" : {
23
+ "node" : " >= 20.11"
24
+ }
36
25
}
Original file line number Diff line number Diff line change 5
5
import { includeBytes } from "fastly:experimental" ;
6
6
import * as jws from "jws" ;
7
7
8
- import fetchConfig from "./config" ;
8
+ import fetchConfig from "./config.js " ;
9
9
10
- import { getQueueCookie , setQueueCookie } from "./cookies" ;
10
+ import { getQueueCookie , setQueueCookie } from "./cookies.js " ;
11
11
12
12
import {
13
13
getStore ,
@@ -16,11 +16,11 @@ import {
16
16
incrementQueueCursor ,
17
17
incrementQueueLength ,
18
18
incrementAutoPeriod ,
19
- } from "./store" ;
19
+ } from "./store.js " ;
20
20
21
- import log from "./logging" ;
21
+ import log from "./logging.js " ;
22
22
23
- import processView from "./views" ;
23
+ import processView from "./views.js " ;
24
24
25
25
const textDecoder = new TextDecoder ( ) ;
26
26
Original file line number Diff line number Diff line change 1
- const path = require ( "path" ) ;
2
- const NodePolyfillPlugin = require ( "node-polyfill-webpack-plugin" ) ;
1
+ import path from "path" ;
2
+ import NodePolyfillPlugin from "node-polyfill-webpack-plugin" ;
3
3
4
- module . exports = {
4
+ export default {
5
5
entry : "./src/index.js" ,
6
6
optimization : {
7
7
minimize : true ,
8
8
} ,
9
9
target : "webworker" ,
10
10
output : {
11
- filename : "index.js" ,
12
- path : path . resolve ( __dirname , "bin" ) ,
13
- libraryTarget : "this" ,
11
+ filename : 'index.cjs' ,
12
+ path : path . resolve ( import . meta. dirname , "bin" ) ,
13
+ chunkFormat : 'commonjs' ,
14
+ library : {
15
+ type : 'commonjs' ,
16
+ } ,
14
17
} ,
15
18
module : {
16
19
// Loaders go here.
@@ -27,11 +30,8 @@ module.exports = {
27
30
} ) ,
28
31
] ,
29
32
externals : [
30
- ( { request, } , callback ) => {
31
- if ( / ^ f a s t l y : .* $ / . test ( request ) ) {
32
- return callback ( null , 'commonjs ' + request ) ;
33
- }
34
- callback ( ) ;
35
- }
33
+ // Allow webpack to handle 'fastly:*' namespaced module imports by treating
34
+ // them as modules rather than trying to process them as URLs
35
+ / ^ f a s t l y : .* $ / ,
36
36
] ,
37
37
} ;
You can’t perform that action at this time.
0 commit comments