{"action":"created","issue":{"url":"https://api.github.com/repos/jlmakes/karma-rollup-preprocessor/issues/17","repository_url":"https://api.github.com/repos/jlmakes/karma-rollup-preprocessor","labels_url":"https://api.github.com/repos/jlmakes/karma-rollup-preprocessor/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/jlmakes/karma-rollup-preprocessor/issues/17/comments","events_url":"https://api.github.com/repos/jlmakes/karma-rollup-preprocessor/issues/17/events","html_url":"https://github.com/jlmakes/karma-rollup-preprocessor/issues/17","id":198278339,"number":17,"title":"Watch doesn't work","user":{"login":"FezVrasta","id":5382443,"avatar_url":"https://avatars.githubusercontent.com/u/5382443?v=3","gravatar_id":"","url":"https://api.github.com/users/FezVrasta","html_url":"https://github.com/FezVrasta","followers_url":"https://api.github.com/users/FezVrasta/followers","following_url":"https://api.github.com/users/FezVrasta/following{/other_user}","gists_url":"https://api.github.com/users/FezVrasta/gists{/gist_id}","starred_url":"https://api.github.com/users/FezVrasta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FezVrasta/subscriptions","organizations_url":"https://api.github.com/users/FezVrasta/orgs","repos_url":"https://api.github.com/users/FezVrasta/repos","events_url":"https://api.github.com/users/FezVrasta/events{/privacy}","received_events_url":"https://api.github.com/users/FezVrasta/received_events","type":"User","site_admin":false},"labels":[{"id":491708124,"url":"https://api.github.com/repos/jlmakes/karma-rollup-preprocessor/labels/more%20information%20needed","name":"more information needed","color":"f9c00c","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2017-01-01T19:21:58Z","updated_at":"2017-01-10T22:34:01Z","closed_at":null,"body":"Hi, first, thanks for maintaining this plugin!\r\n\r\nI'm on `3.0.2` and Node 7, and I have a problem with the watch feature.\r\nThis is my karma configuration:\r\n\r\n```js\r\nautoWatch: true,\r\npreprocessors: {\r\n    [`${root}/src/**/*.js`]: ['rollup'],\r\n    [`${root}/tests/**/*.js`]: ['rollup'],\r\n},\r\nrollupPreprocessor: {\r\n    moduleName: 'test',\r\n    exports: 'named',\r\n    format: 'umd',\r\n    sourceMap: 'inline',\r\n    plugins: [babel({\r\n        presets: [\r\n            ['es2015', { modules: false }],\r\n            'stage-2',\r\n        ],\r\n    })],\r\n},\r\nfiles: [\r\n    { pattern:`${root}/src/**/*.js`, included: false, watched: true },\r\n    `${root}/tests/styles/*.css`,\r\n    `${root}/tests/functional/*.js`,\r\n    `${root}/tests/unit/*.js`,\r\n],\r\n```\r\n\r\nDescribing how my tests work, the test files `import` the source files of my library and rollup takes care to compile everything.\r\n\r\nThe problem is that if I change a file in my tests, the watch task works, if instead I change a file of the source of my library, the bundle isn't updated.\r\n\r\nAm I doing something wrong? Sometimes it works, sometimes not... randomly.\r\n"},"comment":{"url":"https://api.github.com/repos/jlmakes/karma-rollup-preprocessor/issues/comments/271719791","html_url":"https://github.com/jlmakes/karma-rollup-preprocessor/issues/17#issuecomment-271719791","issue_url":"https://api.github.com/repos/jlmakes/karma-rollup-preprocessor/issues/17","id":271719791,"user":{"login":"jlmakes","id":2044842,"avatar_url":"https://avatars.githubusercontent.com/u/2044842?v=3","gravatar_id":"","url":"https://api.github.com/users/jlmakes","html_url":"https://github.com/jlmakes","followers_url":"https://api.github.com/users/jlmakes/followers","following_url":"https://api.github.com/users/jlmakes/following{/other_user}","gists_url":"https://api.github.com/users/jlmakes/gists{/gist_id}","starred_url":"https://api.github.com/users/jlmakes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlmakes/subscriptions","organizations_url":"https://api.github.com/users/jlmakes/orgs","repos_url":"https://api.github.com/users/jlmakes/repos","events_url":"https://api.github.com/users/jlmakes/events{/privacy}","received_events_url":"https://api.github.com/users/jlmakes/received_events","type":"User","site_admin":false},"created_at":"2017-01-10T22:34:01Z","updated_at":"2017-01-10T22:34:01Z","body":">\"yes, it work but karma runs tests twice.\"\r\n\r\nThis is the exact problem I'm looking to solve with version 4. There's no way to programmatically add files to the preprocessor, so instead it has to trick Karma into rebundling them by changing their time modified.\r\n\r\nAs you've pointed out @menangen, this means the tests re-run for each file that depends on the changed file. There also seems to be some issues where tests can fail because files were changed mid-test...\r\n\r\nAll this is to say that the Karma watcher needs to be disabled, and the preprocessor needs to own the watch process (just like Webpack does)."}}
{"actor":{"display_login":"jlmakes"}}