diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a6f7abe..a6c9ddc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,7 @@ jobs: - name: Setup Node uses: actions/setup-node@v3 with: - node-version: '18' + node-version: '20.11' - name: Setup Fastly CLI uses: fastly/compute-actions/setup@v5 - name: Install Dependencies diff --git a/package.json b/package.json index 5bb78b2..d93f3f2 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,11 @@ { - "engines": { - "node": "^18" + "type": "module", + "private": true, + "dependencies": { + "@fastly/js-compute": "^3.33.2" }, "devDependencies": { - "@fastly/cli": "^10.14.0", + "@fastly/cli": "^11.0.0", "buffer": "^6.0.3", "core-js": "^3.33.1", "g": "^2.0.1", @@ -12,16 +14,16 @@ "path-browserify": "^1.0.1", "process": "^0.11.10", "stream-http": "^3.2.0", - "webpack": "^5.89.0", + "webpack": "^5.98.0", "webpack-cli": "^5.1.4" }, - "dependencies": { - "@fastly/js-compute": "^3.0.0" - }, "scripts": { "prebuild": "webpack", "build": "js-compute-runtime bin/index.js bin/main.wasm", "start": "fastly compute serve", "deploy": "fastly compute publish" + }, + "engines": { + "node": ">= 20.11" } } diff --git a/webpack.config.js b/webpack.config.js index 76abf4b..054556a 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,7 +1,10 @@ -const path = require("path"); -const webpack = require("webpack"); +import { createRequire } from "module"; +import path from "path"; +import webpack from "webpack"; -module.exports = { +const require = createRequire(import.meta.url); + +export default { entry: "./src/index.js", optimization: { minimize: true, @@ -9,7 +12,7 @@ module.exports = { target: "webworker", output: { filename: "index.js", - path: path.resolve(__dirname, "bin"), + path: path.resolve(import.meta.dirname, "bin"), libraryTarget: "this", }, module: {