Skip to content

Commit 2fa13e1

Browse files
committed
feat: Migrate to Wrangler V2
1 parent bc1b741 commit 2fa13e1

File tree

11 files changed

+1218
-303
lines changed

11 files changed

+1218
-303
lines changed

package-lock.json

Lines changed: 1183 additions & 279 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

services/auth-cms/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
"type": "module",
1111
"license": "ISC",
1212
"devDependencies": {
13-
"@cloudflare/wrangler": "^1.15.0"
13+
"wrangler": "^2.20.0"
1414
}
1515
}

services/auth-cms/wrangler.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name = "auth-cms"
2-
type = "webpack"
32
workers_dev = true
4-
routes = ["https://alexwilson.tech/auth/cms*"]
3+
routes = ["https://alexwilson.tech/auth/cms*"]
4+
compatibility_date = "2023-07-11"
5+
main = "./src/index.js"

services/cms/package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
"version": "1.0.0",
44
"description": "Netlify-CMS distribution",
55
"scripts": {
6-
"build": "webpack --config webpack.client.cjs",
6+
"build:client": "webpack --config webpack.client.cjs",
7+
"build:worker": "webpack --config webpack.worker.cjs",
8+
"build": "npm-run-all build:*",
79
"deploy:client": "aws s3 sync --acl=public-read --delete ./dist/ s3://alex-static-assets/cms/",
810
"deploy:worker": "wrangler publish",
9-
"deploy": "npm-run-all build deploy:*",
11+
"deploy": "npm-run-all build:* deploy:*",
1012
"test": "npm-run-all build",
1113
"start": "webpack serve --config webpack.client.cjs"
1214
},
@@ -17,7 +19,6 @@
1719
"@babel/core": "^7.18.2",
1820
"@babel/preset-env": "^7.15.8",
1921
"@babel/preset-react": "^7.14.5",
20-
"@cloudflare/wrangler": "^1.15.0",
2122
"ajv": "^8",
2223
"babel-loader": "^9.1.3",
2324
"html-webpack-plugin": "^5.3.2",
@@ -28,7 +29,8 @@
2829
"webpack": "^5.30.0",
2930
"webpack-bundle-analyzer": "^4.4.2",
3031
"webpack-cli": "^5.0.0",
31-
"webpack-dev-server": "^4.3.1"
32+
"webpack-dev-server": "^4.3.1",
33+
"wrangler": "^2.20.0"
3234
},
3335
"dependencies": {
3436
"netlify-cms": "^2.10.111",

services/cms/webpack.client.cjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ module.exports = {
1717
},
1818
output: {
1919
path: path.resolve(__dirname, 'dist'),
20-
filename: '[name].[contenthash].js',
20+
filename: 'client.[contenthash].js',
2121
},
2222
module: {
2323
rules: [
2424
{
2525
test: /\.(js|jsx)$/,
2626
exclude: /node_modules/,
27-
use: ['babel-loader']
27+
use: ['babel-loader']
2828
},
2929
{
3030
test: /\.yml/,
@@ -52,5 +52,5 @@ module.exports = {
5252
directory: path.join(__dirname, 'dist'),
5353
},
5454
port: 9000,
55-
}
56-
}
55+
}
56+
}

services/cms/webpack.worker.cjs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
const path = require('path')
2+
13
module.exports = {
24
target: "webworker",
5+
mode: 'production',
36
resolve: {
47
extensions: ['.js', '.json']
58
},
@@ -11,5 +14,9 @@ module.exports = {
1114
},
1215
entry: {
1316
main: "./worker/index.js"
14-
}
15-
}
17+
},
18+
output: {
19+
path: path.resolve(__dirname, 'dist'),
20+
filename: 'worker.js',
21+
},
22+
}

services/cms/wrangler.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name = "cms"
2-
type = "webpack"
32
workers_dev = true
43
routes = ["https://alexwilson.tech/cms/*"]
5-
webpack_config = "webpack.worker.cjs"
6-
compatibility_date = "2021-10-10"
4+
compatibility_date = "2022-07-12"
5+
main = "./dist/worker.js"
6+
[build]
7+
command = "npm run build"

services/pictures/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
"license": "ISC",
1212
"private": true,
1313
"devDependencies": {
14-
"@cloudflare/wrangler": "^1.15.0"
14+
"wrangler": "^2.20.0"
1515
}
1616
}

services/pictures/wrangler.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name = "pictures"
2-
type = "webpack"
32
workers_dev = true
4-
routes = ["https://alexwilson.tech/pictures/*"]
3+
routes = ["https://alexwilson.tech/pictures/*"]
4+
compatibility_date = "2023-07-11"
5+
main = "./src/index.js"

services/worker-cdn-prod/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
"deploy": "wrangler publish"
1111
},
1212
"devDependencies": {
13-
"@cloudflare/wrangler": "^1.9.1"
14-
},
15-
"dependencies": {
13+
"wrangler": "^2.20.0"
1614
}
1715
}

0 commit comments

Comments
 (0)