🌐 AI搜索 & 代理 主页
Skip to content
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
6 changes: 1 addition & 5 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removed build above was only the first build on Node 20, but I think any of them could have failed. But, I realized lint only runs on Node 18.x, so I moved it there.

if: matrix.NODE_VERSION == '18.x'

- name: Prepare tests
Expand Down
28 changes: 14 additions & 14 deletions build/tasks/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) ];
}
Expand Down Expand Up @@ -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 ) {
Expand Down Expand Up @@ -280,11 +280,6 @@ async function build( {
);
}

const bundle = await rollup.rollup( {
...inputOptions,
plugins: [ rollupFileOverrides( fileOverrides ) ]
} );

const outputOptions = await getOutputRollupOptions( { esm, factory } );

if ( watch ) {
Expand Down Expand Up @@ -326,6 +321,11 @@ async function build( {

return watcher;
} else {
const bundle = await rollup.rollup( {
...inputOptions,
plugins: [ rollupFileOverrides( fileOverrides ) ]
} );

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved this here as it's not needed if watching.

const {
output: [ { code } ]
} = await bundle.generate( outputOptions );
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"build": "node ./build/command.js",
"build:all": "node -e \"require('./build/tasks/build.js').buildDefaultFiles()\"",
"build:main": "node -e \"require('./build/tasks/build.js').build()\"",
"jenkins": "npm run test:browserless",
"jenkins": "npm run pretest && npm run test:browserless",
"lint:dev": "eslint --cache .",
"lint:json": "jsonlint --quiet package.json",
"lint": "concurrently -r \"npm:lint:dev\" \"npm:lint:json\"",
Expand Down