Skip to content

Commit

Permalink
chore: fix typos (#721)
Browse files Browse the repository at this point in the history
  • Loading branch information
sorrycc authored Nov 27, 2023
1 parent 8f3df16 commit 0f0a595
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
4 changes: 2 additions & 2 deletions crates/mako/src/plugins/hmr_runtime/hmr_runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
}
};
requireModule.requireInterceptors.push((options) => {
const orginRequire = options.require;
const originRequire = options.require;
options.module.hot = createModuleHotObject(options.id, options.module);
options.module.meta = {
hot: options.module.hot,
Expand All @@ -191,7 +191,7 @@
options.module.children = [];
options.require = createHmrRequire(options.require, options.id);
options.require.currentHash = () => {
return orginRequire._h;
return originRequire._h;
};
});
requireModule.applyHotUpdate = (chunkId, update, runtime) => {
Expand Down
7 changes: 3 additions & 4 deletions crates/mako/src/plugins/minifish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,9 @@ impl Plugin for MinifishPlugin {

for dep in deps.iter_mut() {
if dep.source.starts_with('/') {
let mut reslove_as = dep.source.clone();
reslove_as.replace_range(0..0, src_root);

dep.resolve_as = Some(reslove_as);
let mut resolve_as = dep.source.clone();
resolve_as.replace_range(0..0, src_root);
dep.resolve_as = Some(resolve_as);
}
}

Expand Down
6 changes: 3 additions & 3 deletions crates/mako/src/transformers/transform_dynamic_import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ mod tests {
use crate::compiler::Context;

#[test]
fn test_dyanmic_import() {
fn test_dynamic_import() {
let code = r#"
import("./foo");
"#
Expand Down Expand Up @@ -157,8 +157,8 @@ Promise.all([

let globals = Globals::default();
GLOBALS.set(&globals, || {
let mut dyanmic_import = DynamicImport { context: &context };
ast.ast.visit_mut_with(&mut dyanmic_import);
let mut dynamic_import = DynamicImport { context: &context };
ast.ast.visit_mut_with(&mut dynamic_import);
});

let (code, _sourcemap) = js_ast_to_code(&ast.ast, &context, "index.js").unwrap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,9 @@ fn parse_barrel_file(path: &str, context: &Arc<Context>) -> Result<(bool, Vec<Ex
});
}
// e.g. `import * as foo from 'foo'`.
ImportSpecifier::Namespace(import_namesapce) => {
ImportSpecifier::Namespace(import_namespace) => {
import_map.push(ImportInfo {
imported: import_namesapce.local.sym.to_string(),
imported: import_namespace.local.sym.to_string(),
src: src.clone(),
orig: "*".to_string(),
})
Expand Down
2 changes: 1 addition & 1 deletion packages/bundler-okam/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ exports.dev = async function (opts) {
const app = express();
const port = opts.port || 8000;
const hmrPort = opts.port + 1;
// cros
// cors
app.use(
require('cors')({
origin: true,
Expand Down

0 comments on commit 0f0a595

Please sign in to comment.