{"action":"created","issue":{"url":"https://api.github.com/repos/shama/stylus-loader/issues/149","repository_url":"https://api.github.com/repos/shama/stylus-loader","labels_url":"https://api.github.com/repos/shama/stylus-loader/issues/149/labels{/name}","comments_url":"https://api.github.com/repos/shama/stylus-loader/issues/149/comments","events_url":"https://api.github.com/repos/shama/stylus-loader/issues/149/events","html_url":"https://github.com/shama/stylus-loader/issues/149","id":178690684,"number":149,"title":"Webpack 2 and plugin loading","user":{"login":"igl","id":293519,"avatar_url":"https://avatars.githubusercontent.com/u/293519?v=3","gravatar_id":"","url":"https://api.github.com/users/igl","html_url":"https://github.com/igl","followers_url":"https://api.github.com/users/igl/followers","following_url":"https://api.github.com/users/igl/following{/other_user}","gists_url":"https://api.github.com/users/igl/gists{/gist_id}","starred_url":"https://api.github.com/users/igl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/igl/subscriptions","organizations_url":"https://api.github.com/users/igl/orgs","repos_url":"https://api.github.com/users/igl/repos","events_url":"https://api.github.com/users/igl/events{/privacy}","received_events_url":"https://api.github.com/users/igl/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-09-22T18:49:52Z","updated_at":"2016-11-28T02:00:57Z","closed_at":null,"body":"## Problem\n\nUsing the options object (`stylus: { ... }`) in webpack2 fails. They validate the config with a schema now.\n\n```\nInvalid configuration object.\nWebpack has been initialised using a configuration object that does not match the API schema.\n- configuration has an unknown property 'stylus'....\n```\n## Fix\n\n```\nLoaders should be updated to allow passing options via loader options in module.rules.\n```\n### and/or\n\nallow strings passed to use. Like: `stylus?use=nib`\n## Workaround 1\n\nMy workaround was to use the loader-string to inject options: `stylus-loader?' + JSON.stringify(stylusOpts)`\n\nThis works nicely however i can't use \"use\" this way:\n\n```\nModule build failed: Error: Plugin should be a function\n```\n## Workaround 2\n\n```\nUntil loaders are updated one can use the LoaderOptionsPlugin to pass these options to the loader:\nplugins: {\nnew webpack.LoaderOptionsPlugin({\n  options: {\n    stylus: ...\n  }\n})\n```\n"},"comment":{"url":"https://api.github.com/repos/shama/stylus-loader/issues/comments/263166952","html_url":"https://github.com/shama/stylus-loader/issues/149#issuecomment-263166952","issue_url":"https://api.github.com/repos/shama/stylus-loader/issues/149","id":263166952,"user":{"login":"mzgoddard","id":833298,"avatar_url":"https://avatars.githubusercontent.com/u/833298?v=3","gravatar_id":"","url":"https://api.github.com/users/mzgoddard","html_url":"https://github.com/mzgoddard","followers_url":"https://api.github.com/users/mzgoddard/followers","following_url":"https://api.github.com/users/mzgoddard/following{/other_user}","gists_url":"https://api.github.com/users/mzgoddard/gists{/gist_id}","starred_url":"https://api.github.com/users/mzgoddard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mzgoddard/subscriptions","organizations_url":"https://api.github.com/users/mzgoddard/orgs","repos_url":"https://api.github.com/users/mzgoddard/repos","events_url":"https://api.github.com/users/mzgoddard/events{/privacy}","received_events_url":"https://api.github.com/users/mzgoddard/received_events","type":"User","site_admin":false},"created_at":"2016-11-28T02:00:57Z","updated_at":"2016-11-28T02:00:57Z","body":"I altered the loader in #154 a little so you can use LoaderOptionsPlugin or OptionsPlugin in stylus-loader (a convenience wrapper for LoaderOptionsPlugin) to set `stylus` on the loader context instead of `options`. Using `stylus` you instead of `options` you should be able to use this with any set of loaders.  Since LoaderOptionsPlugin writes to the loader context used by all loaders for a module, this should help from using LoaderOptionsPlugin being more complicated."}}
{"actor":{"display_login":"mzgoddard"}}