{"action":"created","issue":{"url":"https://api.github.com/repos/jantimon/html-webpack-plugin/issues/1023","repository_url":"https://api.github.com/repos/jantimon/html-webpack-plugin","labels_url":"https://api.github.com/repos/jantimon/html-webpack-plugin/issues/1023/labels{/name}","comments_url":"https://api.github.com/repos/jantimon/html-webpack-plugin/issues/1023/comments","events_url":"https://api.github.com/repos/jantimon/html-webpack-plugin/issues/1023/events","html_url":"https://github.com/jantimon/html-webpack-plugin/issues/1023","id":350214273,"node_id":"MDU6SXNzdWUzNTAyMTQyNzM=","number":1023,"title":"Error in tagged template literal in script tag","user":{"login":"mizchi","id":73962,"node_id":"MDQ6VXNlcjczOTYy","avatar_url":"https://avatars2.githubusercontent.com/u/73962?v=4","gravatar_id":"","url":"https://api.github.com/users/mizchi","html_url":"https://github.com/mizchi","followers_url":"https://api.github.com/users/mizchi/followers","following_url":"https://api.github.com/users/mizchi/following{/other_user}","gists_url":"https://api.github.com/users/mizchi/gists{/gist_id}","starred_url":"https://api.github.com/users/mizchi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mizchi/subscriptions","organizations_url":"https://api.github.com/users/mizchi/orgs","repos_url":"https://api.github.com/users/mizchi/repos","events_url":"https://api.github.com/users/mizchi/events{/privacy}","received_events_url":"https://api.github.com/users/mizchi/received_events","type":"User","site_admin":false},"labels":[{"id":120380152,"node_id":"MDU6TGFiZWwxMjAzODAxNTI=","url":"https://api.github.com/repos/jantimon/html-webpack-plugin/labels/help%20wanted","name":"help wanted","color":"159818","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":14,"created_at":"2018-08-13T22:19:11Z","updated_at":"2019-05-04T10:23:32Z","closed_at":"2019-05-04T10:23:32Z","author_association":"NONE","body":"## Expected behaviour\r\n\r\nPass this code.\r\n\r\n```\r\n<!--  index.html -->\r\n<script>\r\n  if (window.location.hostname !== 'localhost' && window.location.protocol === 'http:') {\r\n    window.location.href = `https://${location.host}/${location.search}`\r\n  }\r\n</script>\r\n```\r\n\r\n## Current behaviour\r\n\r\n```\r\nERROR in Template execution failed: ReferenceError: location is not defined\r\n\r\nERROR in   ReferenceError: location is not defined\r\n\r\n\r\n  - loader.js:4 eval\r\n    [index.html?.]/[html-webpack-plugin]/lib/loader.js:4:10\r\n\r\n  - loader.js:9 module.exports\r\n    [index.html?.]/[html-webpack-plugin]/lib/loader.js:9:3\r\n\r\n  - index.js:284 Promise.resolve.then\r\n    [myapp]/[html-webpack-plugin]/index.js:284:18\r\n\r\n  - next_tick.js:68 process._tickCallback\r\n    internal/process/next_tick.js:68:7\r\n```\r\n\r\n## Environment\r\n\r\n```\r\n    \"webpack\": \"4.16.5\",\r\n    \"html-webpack-plugin\": \"^3.2.0\"\r\n```\r\n\r\n### Config\r\n\r\n```\r\n        new HtmlPlugin({\r\n          template: path.join(__dirname, \"src/index.html\")\r\n        }),\r\n```\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n    <head>\r\n        <title>My App</title>\r\n    </head>\r\n    <body>\r\n    <script>\r\n        if (window.location.hostname !== 'localhost' && window.location.protocol === 'http:') {\r\n          window.location.href = `https://${location.host}/${location.search}`\r\n        }\r\n    </script>\r\n    </body>\r\n</html>\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/jantimon/html-webpack-plugin/issues/comments/489314639","html_url":"https://github.com/jantimon/html-webpack-plugin/issues/1023#issuecomment-489314639","issue_url":"https://api.github.com/repos/jantimon/html-webpack-plugin/issues/1023","id":489314639,"node_id":"MDEyOklzc3VlQ29tbWVudDQ4OTMxNDYzOQ==","user":{"login":"jantimon","id":4113649,"node_id":"MDQ6VXNlcjQxMTM2NDk=","avatar_url":"https://avatars2.githubusercontent.com/u/4113649?v=4","gravatar_id":"","url":"https://api.github.com/users/jantimon","html_url":"https://github.com/jantimon","followers_url":"https://api.github.com/users/jantimon/followers","following_url":"https://api.github.com/users/jantimon/following{/other_user}","gists_url":"https://api.github.com/users/jantimon/gists{/gist_id}","starred_url":"https://api.github.com/users/jantimon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jantimon/subscriptions","organizations_url":"https://api.github.com/users/jantimon/orgs","repos_url":"https://api.github.com/users/jantimon/repos","events_url":"https://api.github.com/users/jantimon/events{/privacy}","received_events_url":"https://api.github.com/users/jantimon/received_events","type":"User","site_admin":false},"created_at":"2019-05-04T10:23:32Z","updated_at":"2019-05-04T10:23:32Z","author_association":"OWNER","body":"Cool 👍"}}
{"actor":{"display_login":"jantimon"}}