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

build: Simplify generation of assets list #56195

Merged
merged 1 commit into from
Sep 13, 2021
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/loader-stats.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node
const path = require( 'path' );
const stats = require( path.join( __dirname, '..', 'build', 'assets-evergreen.json' ) );
const stats = require( path.join( __dirname, '..', 'build', 'assets.json' ) );
const gzipSize = require( 'gzip-size' );
const _ = require( 'lodash' );

Expand Down
2 changes: 1 addition & 1 deletion client/server/middleware/assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import asyncHandler from 'express-async-handler';
import { defaults, groupBy, flatten } from 'lodash';

const ASSETS_PATH = path.resolve( __dirname, '../../../build' );
const ASSETS_FILE = path.join( ASSETS_PATH, `assets-evergreen.json` );
const ASSETS_FILE = path.join( ASSETS_PATH, `assets.json` );
const EMPTY_ASSETS = { js: [], 'css.ltr': [], 'css.rtl': [] };

const getAssetType = ( asset ) => {
Expand Down
2 changes: 1 addition & 1 deletion client/server/pages/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ const buildApp = ( environment ) => {
],
};
mockFs( {
'./build/assets-evergreen.json': JSON.stringify( assets ),
'./build/assets.json': JSON.stringify( assets ),
'./public/evergreen/languages/lang-revisions.json': JSON.stringify( { es: 1234 } ),
} );
tearDown.push( () => mockFs.restore() );
Expand Down
3 changes: 1 addition & 2 deletions client/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,8 @@ const webpackConfig = {
minify: ! isDevelopment,
} ),
new AssetsWriter( {
filename: `assets-${ browserslistEnv === 'defaults' ? 'fallback' : browserslistEnv }.json`,
filename: `assets.json`,
path: path.join( outputDir, 'build' ),
assetExtraPath: extraPath,
} ),
shouldCheckForDuplicatePackages && new DuplicatePackageCheckerPlugin(),
shouldCheckForCycles &&
Expand Down