Skip to content

Commit b287f1e

Browse files
authored
fix: browserslist query and rspack target (#52)
1 parent 36f2b29 commit b287f1e

File tree

10 files changed

+565
-305
lines changed

10 files changed

+565
-305
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,4 +123,4 @@ The project is still in its early stages and under active development, so it pos
123123

124124
| Package | Link |
125125
| ------------ | ------------------------------------------------------- |
126-
| @rspack/core | [PR](https://github.com/web-infra-dev/rspack/pull/7210) |
126+
| @rspack/core | [PR](https://github.com/web-infra-dev/rspack/pull/7394) |

e2e/cases/alias/__snapshots__/index.test.ts.snap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ const a = 'hello world';
99
1010
console.info(a);
1111
12-
export { a };
1312
"
1413
`;
1514

e2e/scripts/shared.ts

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
import { join } from 'node:path';
2-
import { mergeRsbuildConfig as mergeConfig } from '@rsbuild/core';
2+
import {
3+
type InspectConfigResult,
4+
type Rspack,
5+
mergeRsbuildConfig as mergeConfig,
6+
} from '@rsbuild/core';
37
import type { LibConfig, RslibConfig } from '@rslib/core';
48
import { globContentJSON } from '#helper';
59
import { build } from '../../packages/core/src/build';
6-
import { loadConfig } from '../../packages/core/src/config';
10+
import {
11+
composeCreateRsbuildConfig,
12+
loadConfig,
13+
} from '../../packages/core/src/config';
714

815
export function generateBundleEsmConfig(
916
cwd: string,
@@ -103,15 +110,28 @@ export async function getResults(
103110
export const buildAndGetResults = async (
104111
fixturePath: string,
105112
type: 'js' | 'dts' = 'js',
106-
) => {
113+
): Promise<{
114+
contents: Record<string, Record<string, string>>;
115+
files: Record<string, string[]>;
116+
entries: Record<string, string>;
117+
entryFiles: Record<string, string>;
118+
rspackConfig: InspectConfigResult['origin']['bundlerConfigs'];
119+
rsbuildConfig: InspectConfigResult['origin']['rsbuildConfig'];
120+
}> => {
107121
const rslibConfig = await loadConfig(join(fixturePath, 'rslib.config.ts'));
108122
process.chdir(fixturePath);
109-
await build(rslibConfig);
123+
const rsbuildInstance = await build(rslibConfig);
124+
const {
125+
origin: { bundlerConfigs, rsbuildConfig },
126+
} = await rsbuildInstance.inspectConfig({ verbose: true });
127+
110128
const results = await getResults(rslibConfig, fixturePath, type);
111129
return {
112130
contents: results.contents,
113131
files: results.files,
114132
entries: results.entries,
115133
entryFiles: results.entryFiles,
134+
rspackConfig: bundlerConfigs,
135+
rsbuildConfig: rsbuildConfig,
116136
};
117137
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
},
5252
"pnpm": {
5353
"overrides": {
54-
"@rspack/core": "npm:@rspack/[email protected]d77b591-20240718094414"
54+
"@rspack/core": "npm:@rspack/[email protected]338cfbe-20240731183605"
5555
}
5656
}
5757
}

0 commit comments

Comments
 (0)