Skip to content

Commit 236e111

Browse files
haqadnmatticbot
authored andcommitted
Boost: Fix CSS gen library and it's sourcemap to boost. (#37127)
* Copy full bundle for development and fix sourcemap name in dev * changelog Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/8890622319 Upstream-Ref: Automattic/jetpack@5760105
1 parent 7c65424 commit 236e111

File tree

1 file changed

+19
-11
lines changed

1 file changed

+19
-11
lines changed

webpack.config.js

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,26 @@ const cssGenPath = path.dirname(
1010
path.dirname( require.resolve( 'jetpack-boost-critical-css-gen' ) )
1111
);
1212

13-
const cssGenCopyPatterns = [
14-
{
15-
from: path.join( cssGenPath, 'dist/bundle.js' ),
16-
to: 'critical-css-gen.js',
17-
},
18-
];
13+
let cssGenCopyPatterns;
1914

20-
if ( ! isProduction ) {
21-
cssGenCopyPatterns.push( {
22-
from: path.join( cssGenPath, 'dist/bundle.js.map' ),
23-
to: 'critical-css-gen.js.map',
24-
} );
15+
if ( isProduction ) {
16+
cssGenCopyPatterns = [
17+
{
18+
from: path.join( cssGenPath, 'dist/bundle.js' ),
19+
to: 'critical-css-gen.js',
20+
},
21+
];
22+
} else {
23+
cssGenCopyPatterns = [
24+
{
25+
from: path.join( cssGenPath, 'dist/bundle.full.js' ),
26+
to: 'critical-css-gen.js',
27+
},
28+
{
29+
from: path.join( cssGenPath, 'dist/bundle.full.js.map' ),
30+
to: 'bundle.full.js.map',
31+
},
32+
];
2533
}
2634

2735
const imageGuideCopyPatterns = [

0 commit comments

Comments
 (0)