Skip to content

Commit

Permalink
feat: 修复js引入失败问题
Browse files Browse the repository at this point in the history
  • Loading branch information
ximing committed Nov 10, 2020
1 parent c2fb1f7 commit bb4d3f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mpbuild",
"version": "1.4.7",
"version": "1.4.8",
"description": "",
"main": "src/index.js",
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion src/plugin/handleJSDep.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module.exports = class HandleJSDep {
}

apply(mpb) {
mpb.hooks.resolveJS.tap('HandleJSDep',(item) => item);
mpb.hooks.beforeEmitFile.tapPromise('HandleJSDep', async (asset) => {
const deps = [];
try {
Expand All @@ -42,7 +43,7 @@ module.exports = class HandleJSDep {
if (!resolveRes) {
return;
}
lib = resolveRes;
lib = resolveRes.lib;
if (lib[0] === '.') {
try {
libPath = resolve.sync(path.join(asset.dir, lib));
Expand Down

0 comments on commit bb4d3f2

Please sign in to comment.