Skip to content

Commit 908a567

Browse files
authored
Merge branch 'main' into feat/rsbuild-plugin-monaco-editor-nls-example
2 parents 966c896 + 6e47f9d commit 908a567

File tree

6 files changed

+67
-0
lines changed

6 files changed

+67
-0
lines changed

pnpm-lock.yaml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Document</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
</body>
12+
</html>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "example-hooks-after-resolve",
3+
"version": "1.0.0",
4+
"private": true,
5+
"license": "MIT",
6+
"sideEffects": ["**/*.css", "**/*.less", "**/*.scss"],
7+
"main": "index.js",
8+
"scripts": {
9+
"build": "rspack build",
10+
"dev": "rspack serve"
11+
},
12+
"devDependencies": {
13+
"@rspack/cli": "^1.0.3",
14+
"@rspack/core": "^1.0.3"
15+
}
16+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
const rspack = require('@rspack/core');
2+
/** @type {import('@rspack/cli').Configuration} */
3+
const config = {
4+
entry: './src/index.js',
5+
plugins: [
6+
new rspack.HtmlRspackPlugin({
7+
template: './index.html',
8+
}),
9+
{
10+
/**
11+
*
12+
* @param {import('@rspack/core').Compiler} compiler
13+
*/
14+
apply(compiler) {
15+
compiler.hooks.normalModuleFactory.tap('nmf', (nmf) => {
16+
nmf.hooks.afterResolve.tap('afterResolver', (data) => {
17+
console.log('data:', data.createData?.resource);
18+
});
19+
});
20+
},
21+
},
22+
],
23+
};
24+
module.exports = config;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const answer = 42;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { answer } from './answer';
2+
function render() {
3+
document.getElementById('root').innerHTML = `the answer to the universe is ${answer}`;
4+
}
5+
render();

0 commit comments

Comments
 (0)