{"action":"created","issue":{"url":"https://api.github.com/repos/developit/preact-cli/issues/42","repository_url":"https://api.github.com/repos/developit/preact-cli","labels_url":"https://api.github.com/repos/developit/preact-cli/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/developit/preact-cli/issues/42/comments","events_url":"https://api.github.com/repos/developit/preact-cli/issues/42/events","html_url":"https://github.com/developit/preact-cli/issues/42","id":230622376,"number":42,"title":"Build error with preact-material-components","user":{"login":"cedric-marcone","id":1121713,"avatar_url":"https://avatars1.githubusercontent.com/u/1121713?v=3","gravatar_id":"","url":"https://api.github.com/users/cedric-marcone","html_url":"https://github.com/cedric-marcone","followers_url":"https://api.github.com/users/cedric-marcone/followers","following_url":"https://api.github.com/users/cedric-marcone/following{/other_user}","gists_url":"https://api.github.com/users/cedric-marcone/gists{/gist_id}","starred_url":"https://api.github.com/users/cedric-marcone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cedric-marcone/subscriptions","organizations_url":"https://api.github.com/users/cedric-marcone/orgs","repos_url":"https://api.github.com/users/cedric-marcone/repos","events_url":"https://api.github.com/users/cedric-marcone/events{/privacy}","received_events_url":"https://api.github.com/users/cedric-marcone/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":22,"created_at":"2017-05-23T08:08:41Z","updated_at":"2017-05-25T22:18:48Z","closed_at":null,"body":"Hello,\r\n\r\nLinking a component from preact-material-components works like a charm in dev mode but when trying to build for production it fails.\r\n\r\n**Steps to reproduce**\r\n\r\n1) preact create test\r\n2) cd test\r\n3) npm install --save preact-material-components\r\n4) edit routes/home/index.js\r\n5) paste this code :\r\n\r\n```js\r\nimport { h, Component } from 'preact'\r\nimport style from './style'\r\n\r\nimport FormField from 'preact-material-components/FormField'\r\nimport Radio from 'preact-material-components/Radio'\r\n\r\nimport 'preact-material-components/FormField/style.css'\r\nimport 'preact-material-components/Radio/style.css'\r\n\r\n\r\nexport default class Home extends Component {\r\n  render() {\r\n    return (\r\n      <div class={style.home}>\r\n        <h1>Home</h1>\r\n        <FormField>\r\n          <Radio id=\"r1\" name='opts'></Radio>\r\n          <label for=\"r1\">Radio 1</label>\r\n          <Radio id=\"r2\" name='opts'></Radio>\r\n          <label for=\"r2\">Radio 2</label>\r\n        </FormField>\r\n      </div>\r\n    )\r\n  }\r\n}\r\n```\r\n\r\n=> npm start : **OK**\r\n\r\n=> npm run build : **Fails**\r\n\r\n```\r\nTemplate execution failed: SyntaxError: Unexpected token import\r\n  Error: /Users/cedric/Desktop/test/node_modules/preact-material-components/FormField/index.js:1\r\n  (function (exports, require, module, __filename, __dirname) { import { h } from \"preact\";\r\n                                                                ^^^^^^\r\n  SyntaxError: Unexpected token import\r\n  \r\n  - node.js:152 Object.require.extensions.(anonymous function) [as .js]\r\n    [test]/[babel-register]/lib/node.js:152:7\r\n  \r\n  - module.js:20 require\r\n    internal/module.js:20:19\r\n  \r\n  - index.js:4 Object.<anonymous>\r\n    /Users/cedric/Desktop/test/routes/home/index.js:4:1\r\n  \r\n  - node.js:144 loader\r\n    [test]/[babel-register]/lib/node.js:144:5\r\n  \r\n  - node.js:154 Object.require.extensions.(anonymous function) [as .js]\r\n    [test]/[babel-register]/lib/node.js:154:7\r\n  \r\n  - module.js:20 require\r\n    internal/module.js:20:19\r\n  \r\n  - index.js:7 Object.<anonymous>\r\n    /Users/cedric/Desktop/test/index.js:7:1\r\n  \r\n  - node.js:144 loader\r\n    [test]/[babel-register]/lib/node.js:144:5\r\n```\r\n\r\nAny idea ?"},"comment":{"url":"https://api.github.com/repos/developit/preact-cli/issues/comments/304139903","html_url":"https://github.com/developit/preact-cli/issues/42#issuecomment-304139903","issue_url":"https://api.github.com/repos/developit/preact-cli/issues/42","id":304139903,"user":{"login":"developit","id":105127,"avatar_url":"https://avatars1.githubusercontent.com/u/105127?v=3","gravatar_id":"","url":"https://api.github.com/users/developit","html_url":"https://github.com/developit","followers_url":"https://api.github.com/users/developit/followers","following_url":"https://api.github.com/users/developit/following{/other_user}","gists_url":"https://api.github.com/users/developit/gists{/gist_id}","starred_url":"https://api.github.com/users/developit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/developit/subscriptions","organizations_url":"https://api.github.com/users/developit/orgs","repos_url":"https://api.github.com/users/developit/repos","events_url":"https://api.github.com/users/developit/events{/privacy}","received_events_url":"https://api.github.com/users/developit/received_events","type":"User","site_admin":false},"created_at":"2017-05-25T22:18:48Z","updated_at":"2017-05-25T22:18:48Z","body":"k. something's up with that plugin."}}
{"actor":{"display_login":"developit"}}