{"action":"closed","issue":{"url":"https://api.github.com/repos/Tencent/wepy/issues/1687","repository_url":"https://api.github.com/repos/Tencent/wepy","labels_url":"https://api.github.com/repos/Tencent/wepy/issues/1687/labels{/name}","comments_url":"https://api.github.com/repos/Tencent/wepy/issues/1687/comments","events_url":"https://api.github.com/repos/Tencent/wepy/issues/1687/events","html_url":"https://github.com/Tencent/wepy/issues/1687","id":350026617,"node_id":"MDU6SXNzdWUzNTAwMjY2MTc=","number":1687,"title":"引入带命名空间@的第三方依赖，若路径为多层会报错","user":{"login":"sunOpar","id":13537651,"node_id":"MDQ6VXNlcjEzNTM3NjUx","avatar_url":"https://avatars3.githubusercontent.com/u/13537651?v=4","gravatar_id":"","url":"https://api.github.com/users/sunOpar","html_url":"https://github.com/sunOpar","followers_url":"https://api.github.com/users/sunOpar/followers","following_url":"https://api.github.com/users/sunOpar/following{/other_user}","gists_url":"https://api.github.com/users/sunOpar/gists{/gist_id}","starred_url":"https://api.github.com/users/sunOpar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sunOpar/subscriptions","organizations_url":"https://api.github.com/users/sunOpar/orgs","repos_url":"https://api.github.com/users/sunOpar/repos","events_url":"https://api.github.com/users/sunOpar/events{/privacy}","received_events_url":"https://api.github.com/users/sunOpar/received_events","type":"User","site_admin":false},"labels":[{"id":481100581,"node_id":"MDU6TGFiZWw0ODExMDA1ODE=","url":"https://api.github.com/repos/Tencent/wepy/labels/Inactive","name":"Inactive","color":"eeeeee","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-08-13T13:20:16Z","updated_at":"2018-10-19T13:52:35Z","closed_at":"2018-10-19T13:52:35Z","author_association":"NONE","body":"## Description\r\n\r\n同这个问题 [#1272](https://github.com/Tencent/wepy/issues/1272)\r\n\r\n当引用第三方node_modules包时，若该包带命名空间，且为多层路径，会报错\r\n\r\n###  问题代码\r\nhttps://github.com/Tencent/wepy/blob/1.7.x/packages/wepy-cli/src/compile-script.js#L75\r\n\r\n若引入的代码格式为\r\n\r\n```\r\nimport @xxx/xxx/xxx\r\n```\r\n此时会报错，报错代码地址：https://github.com/Tencent/wepy/blob/1.7.x/packages/wepy-cli/src/compile-script.js#L86\r\n\r\n### 原因\r\n\r\n```\r\nlib[0] === '@' && lib.indexOf('/') !== -1 && lib.lastIndexOf('/') === lib.indexOf('/')\r\n```\r\n\r\n是上面的代码只判断路径为一层的情况，即`@xxx/xxx`，若为多层则会进入下一层逻辑判断。\r\n\r\n## 期望\r\n希望能正常引入带有@命名空间且多层路径的第三方依赖。"}}
{"actor":{"display_login":"stale"}}