Skip to content

Commit 30fb1fc

Browse files
authored
Refactor: Remove 'sw-debug.js' from prod output (#1478)
* refactor: sw-debug is now no longer copied to prod builds * docs: Adding changeset * test: Updating test suite to not expect sw-debug in prod * revert: Code style change
1 parent 67fafc8 commit 30fb1fc

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

.changeset/fair-ants-deny.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+
No longer copies 'sw-debug.js' to output directory on prod builds. No functional changes, as it was not used.

packages/cli/lib/lib/webpack/webpack-client-config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ async function clientConfig(env) {
9292
// copy any static files
9393
existsSync(source('assets')) && { from: 'assets', to: 'assets' },
9494
// copy sw-debug
95-
{
95+
!isProd && {
9696
from: resolve(__dirname, '../../resources/sw-debug.js'),
9797
to: 'sw-debug.js',
9898
},

packages/cli/tests/images/build.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ exports.default = exports.full = Object.assign({}, common, {
3030
'ssr-build/ssr-bundle.6e806.css.map': 1250,
3131
'ssr-build/ssr-bundle.js': 9976,
3232
'ssr-build/ssr-bundle.js.map': 30887,
33-
'sw-debug.js': 775,
3433
});
3534
exports['default-esm'] = exports.full = Object.assign({}, exports.default, {
3635
'bundle.*.esm.js': 21135,

0 commit comments

Comments
 (0)