Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
AbanoubGhadban committed Jan 25, 2025
1 parent a2467a7 commit 9ea28f4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions node_package/src/RSCWebpackLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@ const { pathToFileURL } = require('url');
const RSCWebpackLoader = async function Loader(source, sourceMap) {
// Mark loader as async since we're doing async operations
const callback = this.async();

try {
// Convert file path to URL format
const fileUrl = pathToFileURL(this.resourcePath).href;

// eslint-disable-next-line import/no-unresolved
const { load } = await import('react-server-dom-webpack/node-loader');
const result = await load(fileUrl, null, async () => ({
format: 'module',
source,
}));

callback(null, result.source, sourceMap);
} catch (error) {
callback(error);
Expand Down
5 changes: 4 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
"incremental": true,
"target": "es5"
},
"include": ["node_package/src/**/*"],
"include": [
"node_package/src/**/*",
"node_package/types/**/*"
],
"exclude": ["node_package/src/RSCWebpackLoader.js"]
}

0 comments on commit 9ea28f4

Please sign in to comment.