mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Build: fix inconsistent builds in Node 20
- one fileOverrides per build - only run the lint build when running lint Close gh-5332
This commit is contained in:
parent
77d6ad7172
commit
7ef9099d32
6
.github/workflows/node.js.yml
vendored
6
.github/workflows/node.js.yml
vendored
@ -70,12 +70,8 @@ jobs:
|
||||
run: npx playwright-webkit install-deps
|
||||
if: matrix.NPM_SCRIPT == 'test:browser' && contains(matrix.BROWSERS, 'WebkitHeadless')
|
||||
|
||||
- name: Build jQuery for Lint
|
||||
run: npm run build:all
|
||||
if: matrix.NPM_SCRIPT == 'test:browserless'
|
||||
|
||||
- name: Lint code
|
||||
run: npm run lint
|
||||
run: npm run build:all && npm run lint
|
||||
if: matrix.NODE_VERSION == '18.x'
|
||||
|
||||
- name: Prepare tests
|
||||
|
@ -102,15 +102,6 @@ async function getOutputRollupOptions( {
|
||||
};
|
||||
}
|
||||
|
||||
const fileOverrides = new Map();
|
||||
|
||||
function setOverride( filePath, source ) {
|
||||
|
||||
// We want normalized paths in overrides as they will be matched
|
||||
// against normalized paths in the file overrides Rollup plugin.
|
||||
fileOverrides.set( path.resolve( filePath ), source );
|
||||
}
|
||||
|
||||
function unique( array ) {
|
||||
return [ ...new Set( array ) ];
|
||||
}
|
||||
@ -179,6 +170,15 @@ async function build( {
|
||||
} = {} ) {
|
||||
const pureSlim = slim && !exclude.length && !include.length;
|
||||
|
||||
const fileOverrides = new Map();
|
||||
|
||||
function setOverride( filePath, source ) {
|
||||
|
||||
// We want normalized paths in overrides as they will be matched
|
||||
// against normalized paths in the file overrides Rollup plugin.
|
||||
fileOverrides.set( path.resolve( filePath ), source );
|
||||
}
|
||||
|
||||
// Add the short commit hash to the version string
|
||||
// when the version is not for a release.
|
||||
if ( !version ) {
|
||||
@ -280,11 +280,6 @@ async function build( {
|
||||
);
|
||||
}
|
||||
|
||||
const bundle = await rollup.rollup( {
|
||||
...inputOptions,
|
||||
plugins: [ rollupFileOverrides( fileOverrides ) ]
|
||||
} );
|
||||
|
||||
const outputOptions = await getOutputRollupOptions( { esm, factory } );
|
||||
|
||||
if ( watch ) {
|
||||
@ -326,6 +321,11 @@ async function build( {
|
||||
|
||||
return watcher;
|
||||
} else {
|
||||
const bundle = await rollup.rollup( {
|
||||
...inputOptions,
|
||||
plugins: [ rollupFileOverrides( fileOverrides ) ]
|
||||
} );
|
||||
|
||||
const {
|
||||
output: [ { code } ]
|
||||
} = await bundle.generate( outputOptions );
|
||||
|
Loading…
Reference in New Issue
Block a user