Skip to content

Commit 7afd8bb

Browse files
refactor: build test suite (#1670)
Co-authored-by: Leah <github.leah@hrmny.sh>
1 parent 0346549 commit 7afd8bb

File tree

50 files changed

+522
-223
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+522
-223
lines changed

.changeset/purple-chefs-yell.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'preact-cli': patch
3+
---
4+
5+
Corrects 'build --json' ouput location and 'apple-touch-icon' will respect the publicPath automatically

packages/cli/lib/commands/build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ async function command(src, argv) {
107107
let stats = await runWebpack(argv, false);
108108

109109
if (argv.json) {
110-
await runWebpack.writeJsonStats(stats);
110+
await runWebpack.writeJsonStats(cwd, stats);
111111
}
112112
}
113113

packages/cli/lib/lib/webpack/run-webpack.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ function showStats(stats, isProd) {
122122
return stats;
123123
}
124124

125-
function writeJsonStats(stats) {
126-
let outputPath = resolve(process.cwd(), 'stats.json');
125+
function writeJsonStats(cwd, stats) {
126+
let outputPath = resolve(cwd, 'stats.json');
127127
let jsonStats = stats.toJson({
128128
json: true,
129129
chunkModules: true,

packages/cli/lib/resources/template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<meta name="viewport" content="width=device-width,initial-scale=1">
77
<meta name="mobile-web-app-capable" content="yes">
88
<meta name="apple-mobile-web-app-capable" content="yes">
9-
<link rel="apple-touch-icon" href="/assets/icons/apple-touch-icon.png">
9+
<link rel="apple-touch-icon" href="<%= htmlWebpackPlugin.files.publicPath %>assets/icons/apple-touch-icon.png">
1010
<% preact.headEnd %>
1111
</head>
1212
<body>

0 commit comments

Comments
 (0)