Skip to content

Commit 6ad42c1

Browse files
committed
build: update config files
1 parent 3fccbf7 commit 6ad42c1

File tree

5 files changed

+28
-102
lines changed

5 files changed

+28
-102
lines changed

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22
/vendor/
33
/wordpress/
44
node_modules/
5-
dist/
5+
dist/
6+
7+
.DS_Store

composer.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "upstatement/timber-starter-theme",
33
"description": "Starter theme to build a Timber theme",
4-
"type":"wordpress-theme",
4+
"type": "wordpress-theme",
55
"license": "MIT",
66
"authors": [
77
{
@@ -31,7 +31,8 @@
3131
},
3232
"require-dev": {
3333
"automattic/wordbless": "^0.4.2",
34-
"yoast/wp-test-utils": "^1.0"
34+
"yoast/wp-test-utils": "^1.0",
35+
"php-stubs/acf-pro-stubs": "^6.2"
3536
},
3637
"extra": {
3738
"installer-paths": {
@@ -45,6 +46,9 @@
4546
"allow-plugins": {
4647
"roots/wordpress-core-installer": true,
4748
"composer/installers": true
49+
},
50+
"platform": {
51+
"php": "8.3.6"
4852
}
4953
},
5054
"scripts": {

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
"build": "vite build"
1111
},
1212
"devDependencies": {
13-
"laravel-vite-plugin": "^1.0.2",
1413
"sass": "^1.77.1",
1514
"vite": "^5.2.11"
1615
},

vite.config.js

+18-10
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,46 @@
11
import path from "path";
22
import { defineConfig } from "vite";
3-
import laravel from "laravel-vite-plugin";
43

5-
const ROOT = path.resolve("../../../");
6-
const BASE = __dirname.replace(ROOT, "");
4+
const unhashedFiles = ["critical.css"];
75

86
export default defineConfig({
9-
// base: process.env.NODE_ENV === "production" ? `${BASE}/dist/` : BASE,
107
base: "",
118
build: {
129
manifest: "manifest.json",
1310
assetsDir: "assets",
1411
outDir: "dist",
1512
emptyOutDir: true,
1613
sourcemap: true,
14+
rollupOptions: {
15+
input: [
16+
"resources/scripts/app.js",
17+
"resources/styles/styles.scss",
18+
"resources/styles/critical.scss",
19+
],
20+
output: {
21+
entryFileNames: `[hash].js`,
22+
assetFileNames: function (file) {
23+
return unhashedFiles.includes(file.name)
24+
? `[name].[ext]`
25+
: `[hash].[ext]`;
26+
},
27+
},
28+
},
1729
},
1830
plugins: [
19-
laravel({
20-
publicDirectory: "dist",
21-
input: ["resources/scripts/app.js", "resources/styles/styles.scss"],
22-
}),
2331
{
2432
name: "php",
2533
handleHotUpdate({ file, server }) {
2634
if (file.endsWith(".php")) {
27-
server.ws.send({ type: "full-reload" });
35+
server.hot.send({ type: "full-reload" });
2836
}
2937
},
3038
},
3139
{
3240
name: "twig",
3341
handleHotUpdate({ file, server }) {
3442
if (file.endsWith(".twig")) {
35-
server.ws.send({ type: "full-reload" });
43+
server.hot.send({ type: "full-reload" });
3644
}
3745
},
3846
},

yarn.lock

+1-88
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@
22
# yarn lockfile v1
33

44

5-
"@babel/runtime@^7.8.4":
6-
version "7.24.7"
7-
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.24.7.tgz#f4f0d5530e8dbdf59b3451b9b3e594b6ba082e12"
8-
integrity sha512-UwgBRMjJP+xv857DCngvqXI3Iq6J4v0wXmwc6sapg+zyhbwmQX67LUEFrkK5tbyJ30jGuG3ZvWpBiB9LCy1kWw==
9-
dependencies:
10-
regenerator-runtime "^0.14.0"
11-
125
"@esbuild/aix-ppc64@0.20.2":
136
version "0.20.2"
147
resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz#a70f4ac11c6a1dfc18b8bbb13284155d933b9537"
@@ -217,24 +210,11 @@ anymatch@~3.1.2:
217210
normalize-path "^3.0.0"
218211
picomatch "^2.0.4"
219212

220-
balanced-match@^1.0.0:
221-
version "1.0.2"
222-
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
223-
integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==
224-
225213
binary-extensions@^2.0.0:
226214
version "2.3.0"
227215
resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.3.0.tgz#f6e14a97858d327252200242d4ccfe522c445522"
228216
integrity sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==
229217

230-
brace-expansion@^1.1.7:
231-
version "1.1.11"
232-
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
233-
integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==
234-
dependencies:
235-
balanced-match "^1.0.0"
236-
concat-map "0.0.1"
237-
238218
braces@~3.0.2:
239219
version "3.0.2"
240220
resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107"
@@ -257,11 +237,6 @@ braces@~3.0.2:
257237
optionalDependencies:
258238
fsevents "~2.3.2"
259239

260-
concat-map@0.0.1:
261-
version "0.0.1"
262-
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
263-
integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==
264-
265240
esbuild@^0.20.1:
266241
version "0.20.2"
267242
resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.20.2.tgz#9d6b2386561766ee6b5a55196c6d766d28c87ea1"
@@ -298,11 +273,6 @@ fill-range@^7.0.1:
298273
dependencies:
299274
to-regex-range "^5.0.1"
300275

301-
foreachasync@^3.0.0:
302-
version "3.0.0"
303-
resolved "https://registry.yarnpkg.com/foreachasync/-/foreachasync-3.0.0.tgz#5502987dc8714be3392097f32e0071c9dee07cf6"
304-
integrity sha512-J+ler7Ta54FwwNcx6wQRDhTIbNeyDcARMkOcguEqnEdtm0jKvN3Li3PDAb2Du3ubJYEWfYL83XMROXdsXAXycw==
305-
306276
fsevents@~2.3.2, fsevents@~2.3.3:
307277
version "2.3.3"
308278
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6"
@@ -344,26 +314,6 @@ is-number@^7.0.0:
344314
resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b"
345315
integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==
346316

347-
laravel-vite-plugin@^1.0.2:
348-
version "1.0.2"
349-
resolved "https://registry.yarnpkg.com/laravel-vite-plugin/-/laravel-vite-plugin-1.0.2.tgz#97575181a1f870532b39ab3b423b53f01385feba"
350-
integrity sha512-Mcclml10khYzBVxDwJro8wnVDwD4i7XOSEMACQNnarvTnHjrjXLLL+B/Snif2wYAyElsOqagJZ7VAinb/2vF5g==
351-
dependencies:
352-
picocolors "^1.0.0"
353-
vite-plugin-full-reload "^1.1.0"
354-
355-
locutus@^2.0.11:
356-
version "2.0.32"
357-
resolved "https://registry.yarnpkg.com/locutus/-/locutus-2.0.32.tgz#4468e0a73b74e5c26a3d1b94394e6e1275e2bcec"
358-
integrity sha512-fr7OCpbE4xeefhHqfh6hM2/l9ZB3XvClHgtgFnQNImrM/nqL950o6FO98vmUH8GysfQRCcyBYtZ4C8GcY52Edw==
359-
360-
minimatch@3.0.x:
361-
version "3.0.8"
362-
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.8.tgz#5e6a59bd11e2ab0de1cfb843eb2d82e546c321c1"
363-
integrity sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==
364-
dependencies:
365-
brace-expansion "^1.1.7"
366-
367317
modujs@^1.4.2:
368318
version "1.4.2"
369319
resolved "https://registry.yarnpkg.com/modujs/-/modujs-1.4.2.tgz#25e56c291a7d710ae8ef35aa29a2c3b759e85296"
@@ -389,7 +339,7 @@ picocolors@^1.0.0:
389339
resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c"
390340
integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==
391341

392-
picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.3.1:
342+
picomatch@^2.0.4, picomatch@^2.2.1:
393343
version "2.3.1"
394344
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42"
395345
integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==
@@ -410,11 +360,6 @@ readdirp@~3.6.0:
410360
dependencies:
411361
picomatch "^2.2.1"
412362

413-
regenerator-runtime@^0.14.0:
414-
version "0.14.1"
415-
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f"
416-
integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==
417-
418363
rollup@^4.13.0:
419364
version "4.17.2"
420365
resolved "https://registry.yarnpkg.com/rollup/-/rollup-4.17.2.tgz#26d1785d0144122277fdb20ab3a24729ae68301f"
@@ -461,31 +406,6 @@ to-regex-range@^5.0.1:
461406
dependencies:
462407
is-number "^7.0.0"
463408

464-
twig@^1.15.4:
465-
version "1.17.1"
466-
resolved "https://registry.yarnpkg.com/twig/-/twig-1.17.1.tgz#2e4b158cbd072e93deac009d76a807a3d9966b24"
467-
integrity sha512-atxccyr/BHtb1gPMA7Lvki0OuU17XBqHsNH9lzDHt9Rr1293EVZOosSZabEXz/DPVikIW8ZDqSkEddwyJnQN2w==
468-
dependencies:
469-
"@babel/runtime" "^7.8.4"
470-
locutus "^2.0.11"
471-
minimatch "3.0.x"
472-
walk "2.3.x"
473-
474-
vite-plugin-full-reload@^1.1.0:
475-
version "1.1.0"
476-
resolved "https://registry.yarnpkg.com/vite-plugin-full-reload/-/vite-plugin-full-reload-1.1.0.tgz#ca6fa32631024a459ea9e5613dd4c0ff0f3b7995"
477-
integrity sha512-3cObNDzX6DdfhD9E7kf6w2mNunFpD7drxyNgHLw+XwIYAgb+Xt16SEXo0Up4VH+TMf3n+DSVJZtW2POBGcBYAA==
478-
dependencies:
479-
picocolors "^1.0.0"
480-
picomatch "^2.3.1"
481-
482-
vite-plugin-twig@^2.1.1:
483-
version "2.1.1"
484-
resolved "https://registry.yarnpkg.com/vite-plugin-twig/-/vite-plugin-twig-2.1.1.tgz#ac1d46ce7bd545f77c086467b5f534729f5db823"
485-
integrity sha512-InQAu+HZ7ctf5HdcwFSlvC8usVmIUACQdbLjwFeKZ1b5ey+9M0ptMz9CN4ysY5tQsOmMwNxUK6bgRRLQNnziVw==
486-
dependencies:
487-
twig "^1.15.4"
488-
489409
vite@^5.2.11:
490410
version "5.2.11"
491411
resolved "https://registry.yarnpkg.com/vite/-/vite-5.2.11.tgz#726ec05555431735853417c3c0bfb36003ca0cbd"
@@ -496,10 +416,3 @@ vite@^5.2.11:
496416
rollup "^4.13.0"
497417
optionalDependencies:
498418
fsevents "~2.3.3"
499-
500-
walk@2.3.x:
501-
version "2.3.15"
502-
resolved "https://registry.yarnpkg.com/walk/-/walk-2.3.15.tgz#1b4611e959d656426bc521e2da5db3acecae2424"
503-
integrity sha512-4eRTBZljBfIISK1Vnt69Gvr2w/wc3U6Vtrw7qiN5iqYJPH7LElcYh/iU4XWhdCy2dZqv1ToMyYlybDylfG/5Vg==
504-
dependencies:
505-
foreachasync "^3.0.0"

0 commit comments

Comments
 (0)