{"action":"opened","issue":{"url":"https://api.github.com/repos/esnunes/riotjs-loader/issues/16","labels_url":"https://api.github.com/repos/esnunes/riotjs-loader/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/esnunes/riotjs-loader/issues/16/comments","events_url":"https://api.github.com/repos/esnunes/riotjs-loader/issues/16/events","html_url":"https://github.com/esnunes/riotjs-loader/issues/16","id":124972428,"number":16,"title":"About external script file","user":{"login":"cncolder","id":127009,"avatar_url":"https://avatars.githubusercontent.com/u/127009?v=3","gravatar_id":"","url":"https://api.github.com/users/cncolder","html_url":"https://github.com/cncolder","followers_url":"https://api.github.com/users/cncolder/followers","following_url":"https://api.github.com/users/cncolder/following{/other_user}","gists_url":"https://api.github.com/users/cncolder/gists{/gist_id}","starred_url":"https://api.github.com/users/cncolder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cncolder/subscriptions","organizations_url":"https://api.github.com/users/cncolder/orgs","repos_url":"https://api.github.com/users/cncolder/repos","events_url":"https://api.github.com/users/cncolder/events{/privacy}","received_events_url":"https://api.github.com/users/cncolder/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-05T13:58:47Z","updated_at":"2016-01-05T13:58:47Z","closed_at":null,"body":"Since I have sent a pull request [https://github.com/esnunes/riotjs-loader/pull/15](https://github.com/esnunes/riotjs-loader/pull/15) about compile external script file. But I still have a question. I need to tell webpack our tag file dependency that external js file. So that webpack should recompile in watch mode after I save my js file.\r\n\r\nI can't find a good way to do that. I have some ugly code in my own code. Use regex match source string then add dependency it.\r\n\r\n```javascript\r\n    var match = /<script.*?src=\"(.*?)\"/gmi.exec(source)\r\n    if (match) {\r\n      let script = path.resolve(path.dirname(this.resourcePath), match[1])\r\n      this.dependency(script)\r\n    }\r\n```\r\n\r\nIf someone thinking this is acceptable or provide a better regex. I can make this loader work better."}}