Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: build test suite #1670

Merged
merged 6 commits into from Apr 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/purple-chefs-yell.md
@@ -0,0 +1,5 @@
---
'preact-cli': patch
---

Corrects 'build --json' ouput location and 'apple-touch-icon' will respect the publicPath automatically
2 changes: 1 addition & 1 deletion packages/cli/lib/commands/build.js
Expand Up @@ -107,7 +107,7 @@ async function command(src, argv) {
let stats = await runWebpack(argv, false);

if (argv.json) {
await runWebpack.writeJsonStats(stats);
await runWebpack.writeJsonStats(cwd, stats);
}
}

Expand Down
4 changes: 2 additions & 2 deletions packages/cli/lib/lib/webpack/run-webpack.js
Expand Up @@ -122,8 +122,8 @@ function showStats(stats, isProd) {
return stats;
}

function writeJsonStats(stats) {
let outputPath = resolve(process.cwd(), 'stats.json');
function writeJsonStats(cwd, stats) {
let outputPath = resolve(cwd, 'stats.json');
let jsonStats = stats.toJson({
json: true,
chunkModules: true,
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/lib/resources/template.html
Expand Up @@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<link rel="apple-touch-icon" href="/assets/icons/apple-touch-icon.png">
<link rel="apple-touch-icon" href="<%= htmlWebpackPlugin.files.publicPath %>assets/icons/apple-touch-icon.png">
<% preact.headEnd %>
</head>
<body>
Expand Down