Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add global __mako_chunk_load__ #1111

Merged
merged 1 commit into from
May 6, 2024
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
1 change: 1 addition & 0 deletions crates/mako/templates/app_runtime.stpl
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ function createRuntime(makoModules, entryModuleId, global) {
// __inject_runtime_code__

global.__mako_require_module__ = requireModule;
global.__mako_chunk_load__ = requireModule.ensure;
<% if umd.is_some() || cjs { %>
var exports = requireModule(entryModuleId);
<% } else { %>
Expand Down
7 changes: 5 additions & 2 deletions examples/rsc/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,11 @@ module.exports = {$$typeof: Symbol.for(\"react.module.reference\"),filepath:\"{{
});

// build client
fs.rmdirSync(path.join(root, 'tmp'), { recursive: true });
fs.mkdirSync(path.join(root, 'tmp'));
let tmpDir = path.join(root, 'tmp');
if (fs.existsSync(tmpDir)) {
fs.rmdirSync(tmpDir, { recursive: true });
}
fs.mkdirSync(tmpDir);
let stats = fs.readFileSync(
path.join(serverOutputPath, 'stats.json'),
'utf-8',
Expand Down
Loading