Skip to content

Commit

Permalink
upd
Browse files Browse the repository at this point in the history
  • Loading branch information
okbug committed Aug 26, 2022
1 parent f05c9c8 commit d0524e2
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 20 deletions.
26 changes: 13 additions & 13 deletions packages/learn-webpack/ast/class2function.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,19 @@ const transformClasses = {
)
);
}
// if (classMethod.leadingComments) {
// classMethod.leadingComments.forEach((comment) => {
// if (comment.value.trim().startsWith("@need-try")) {
// const _comment = comment.value.trim();
// const tryEventName = _comment.split(" ")[1] || "test";
// let catchMessage = getCatchStatement(tryEventName);
// let catchClause = types.catchClause(types.identifier(error), types.blockStatement(catchMessage));
// const body = p.right.body;
// if (types.isTryStatement(p.right.body.body)) return
// p.right.body.body = types.tryStatement(body, catchClause)
// }
// });
// }
// if (classMethod.leadingComments) {
// classMethod.leadingComments.forEach((comment) => {
// if (comment.value.trim().startsWith("@need-try")) {
// const _comment = comment.value.trim();
// const tryEventName = _comment.split(" ")[1] || "test";
// let catchMessage = getCatchStatement(tryEventName);
// let catchClause = types.catchClause(types.identifier(error), types.blockStatement(catchMessage));
// const body = p.right.body;
// if (types.isTryStatement(p.right.body.body)) return
// p.right.body.body = types.tryStatement(body, catchClause)
// }
// });
// }
newNodes.push(p);
});
if (newNodes.length === 1) {
Expand Down
14 changes: 7 additions & 7 deletions packages/learn-webpack/debugger.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ const compiler = webpack(config);
// console.log(compiler)
compiler.run((err, state) => {
console.log(err);
// console.log(state.toJson({
// assets: true,
// chunks: true,
// modules: true,
// entries: true
// }))
console.log(state.toJson({
// assets: true,
// chunks: true,
modules: true,
// entries: true
}))
})

// console.log(compiler.run)
console.log(compiler.hooks.done);
console.log(compiler.hooks.done);
1 change: 1 addition & 0 deletions packages/learn-webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"@babel/plugin-transform-classes": "^7.18.9",
"@babel/preset-env": "^7.18.10",
"babel-types": "^6.26.0",
"raw-loader": "^4.0.2",
"webpack": "^5.74.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.10.0"
Expand Down
3 changes: 3 additions & 0 deletions packages/learn-webpack/src/1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const loader = require('raw-loader')
console.log(typeof loader)
// loader()

0 comments on commit d0524e2

Please sign in to comment.