Skip to content

Commit 4592b5a

Browse files
author
Michael Hladky
committed
refactor: format
1 parent 86ae280 commit 4592b5a

File tree

6 files changed

+33
-27
lines changed

6 files changed

+33
-27
lines changed

packages/plugin-bundle-stats/mocks/fixtures/node-minimal/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ This project supports multiple build tools:
1515

1616
The Vite build configuration includes:
1717

18-
- **Entry Points**:
18+
- **Entry Points**:
1919
- `index.html``main.js` (main application)
2020
- `src/bin.ts``bin.js` (CLI entry point)
2121
- **Output Directory**: `dist/vite/`
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
3-
<head>
4-
<meta charset="UTF-8">
5-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<title>Node Minimal Fixture</title>
7-
</head>
8-
<body>
7+
</head>
8+
<body>
99
<div id="app"></div>
1010
<script type="module" src="/src/index.ts"></script>
11-
</body>
12-
</html>
11+
</body>
12+
</html>

packages/plugin-bundle-stats/mocks/fixtures/node-minimal/rsbuild.script.cjs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,26 @@ async function build() {
66
try {
77
// Load the config from rsbuild.config.ts
88
const { content } = await loadConfig();
9-
9+
1010
const rsbuild = await createRsbuild({
1111
rsbuildConfig: content,
1212
});
1313

1414
const { stats } = await rsbuild.build();
15-
15+
1616
// Ensure output directory exists
1717
const outputDir = 'dist/rsbuild';
1818
if (!fs.existsSync(outputDir)) {
1919
fs.mkdirSync(outputDir, { recursive: true });
2020
}
21-
21+
2222
// Write stats.json
23-
fs.writeFileSync(path.join(outputDir, 'stats.json'), JSON.stringify(stats.toJson(), null, 2));
23+
fs.writeFileSync(
24+
path.join(outputDir, 'stats.json'),
25+
JSON.stringify(stats.toJson(), null, 2),
26+
);
2427
console.log(`Stats written to ${outputDir}/stats.json`);
25-
28+
2629
console.log('Build completed successfully!');
2730
process.exit(0);
2831
} catch (error) {
@@ -31,4 +34,4 @@ async function build() {
3134
}
3235
}
3336

34-
build();
37+
build();

packages/plugin-bundle-stats/mocks/fixtures/node-minimal/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
},
1313
"include": ["src/**/*"],
1414
"exclude": ["node_modules", "dist"]
15-
}
15+
}

packages/plugin-bundle-stats/mocks/fixtures/node-minimal/vite.script.cjs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@ const path = require('path');
77
*/
88
function build() {
99
console.log('Building with Vite...');
10-
10+
1111
try {
1212
// Clean the dist directory
1313
const distDir = path.join(__dirname, 'dist', 'vite');
1414
if (fs.existsSync(distDir)) {
1515
fs.rmSync(distDir, { recursive: true });
1616
}
17-
17+
1818
// Run Vite build
19-
execSync('npx vite build', {
19+
execSync('npx vite build', {
2020
stdio: 'inherit',
21-
cwd: __dirname
21+
cwd: __dirname,
2222
});
23-
23+
2424
console.log('Vite build completed successfully!');
2525
} catch (error) {
2626
console.error('Vite build failed:', error.message);
@@ -32,4 +32,4 @@ if (require.main === module) {
3232
build();
3333
}
3434

35-
module.exports = { build };
35+
module.exports = { build };

packages/plugin-bundle-stats/mocks/fixtures/node-minimal/webpack.script.cjs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,20 @@ compiler.run((err, stats) => {
1010
console.error(err);
1111
process.exit(1);
1212
}
13-
13+
1414
// Ensure output directory exists
1515
const outputDir = 'dist/webpack';
1616
if (!fs.existsSync(outputDir)) {
1717
fs.mkdirSync(outputDir, { recursive: true });
1818
}
19-
19+
2020
// Write stats.json
21-
fs.writeFileSync(path.join(outputDir, 'stats.json'), JSON.stringify(stats.toJson(), null, 2));
21+
fs.writeFileSync(
22+
path.join(outputDir, 'stats.json'),
23+
JSON.stringify(stats.toJson(), null, 2),
24+
);
2225
console.log(`Stats written to ${outputDir}/stats.json`);
23-
26+
2427
console.log('Build completed successfully!');
2528
compiler.close(() => process.exit(0));
26-
});
29+
});

0 commit comments

Comments
 (0)