{"action":"closed","issue":{"url":"https://api.github.com/repos/static-dev/spike-core/issues/134","repository_url":"https://api.github.com/repos/static-dev/spike-core","labels_url":"https://api.github.com/repos/static-dev/spike-core/issues/134/labels{/name}","comments_url":"https://api.github.com/repos/static-dev/spike-core/issues/134/comments","events_url":"https://api.github.com/repos/static-dev/spike-core/issues/134/events","html_url":"https://github.com/static-dev/spike-core/issues/134","id":157746874,"number":134,"title":"Allow custom options","user":{"login":"jescalan","id":556932,"avatar_url":"https://avatars.githubusercontent.com/u/556932?v=3","gravatar_id":"","url":"https://api.github.com/users/jescalan","html_url":"https://github.com/jescalan","followers_url":"https://api.github.com/users/jescalan/followers","following_url":"https://api.github.com/users/jescalan/following{/other_user}","gists_url":"https://api.github.com/users/jescalan/gists{/gist_id}","starred_url":"https://api.github.com/users/jescalan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jescalan/subscriptions","organizations_url":"https://api.github.com/users/jescalan/orgs","repos_url":"https://api.github.com/users/jescalan/repos","events_url":"https://api.github.com/users/jescalan/events{/privacy}","received_events_url":"https://api.github.com/users/jescalan/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/static-dev/spike-core/labels/enhancement","name":"enhancement","color":"bfd4f2"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/static-dev/spike-core/milestones/1","html_url":"https://github.com/static-dev/spike-core/milestones/v1%20stable","labels_url":"https://api.github.com/repos/static-dev/spike-core/milestones/1/labels","id":1775088,"number":1,"title":"v1 stable","description":":cactus:","creator":{"login":"kylemac","id":49507,"avatar_url":"https://avatars.githubusercontent.com/u/49507?v=3","gravatar_id":"","url":"https://api.github.com/users/kylemac","html_url":"https://github.com/kylemac","followers_url":"https://api.github.com/users/kylemac/followers","following_url":"https://api.github.com/users/kylemac/following{/other_user}","gists_url":"https://api.github.com/users/kylemac/gists{/gist_id}","starred_url":"https://api.github.com/users/kylemac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kylemac/subscriptions","organizations_url":"https://api.github.com/users/kylemac/orgs","repos_url":"https://api.github.com/users/kylemac/repos","events_url":"https://api.github.com/users/kylemac/events{/privacy}","received_events_url":"https://api.github.com/users/kylemac/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":8,"state":"open","created_at":"2016-05-18T22:41:03Z","updated_at":"2016-06-02T16:22:50Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2016-05-31T19:08:27Z","updated_at":"2016-06-02T16:22:50Z","closed_at":"2016-06-02T16:22:50Z","body":"Right now, any options that are passed in to the config but that are not explicitly handled do not make it to the final webpack config object. For example, if you were using a loader like the less loader or something that used the `less` key on the webpack config object, it would not work, since we have a protective layer over the webpack config object (which we did for a good reason).\r\n\r\nBefore we ship anything stable we need a solution to this. The issue is that adding arbitrary properties to the webpack config object is not really a good practice nor is it a good API for options, when it comes down to it, since they are mixed in with a variety of essential webpack config keys. For example, what if there was a loader for a language called `context` that accepted functions? Adding the `context` key to the webpack object would override an essential config value and completely destroy the functionality of the compile, while being entirely confusing to users.\r\n\r\nIt also creates a namespace issue. For example, we have a jade client loader and a jade static loader, and they both take options from the `jade` key, which coincidentally the 'webpack official' jade loader does not use since it takes all options via querystring (no, you cannot pass a function as a local to it, surprisingly, and nobody has complained about this). This is just icky and is not a good design pattern at all. It's not our fault, it's the fault of an API that has not been well-thought-out and is kind of cobbled together, waiting for a disaster to happen.\r\n\r\nHowever, we have an opportunity to wrap and therefore improve on that API. Just want to open up this discussion to see if anyone has thoughts on the best way to do this! The end result should allow users to add properties to the webpack config object directly only *when needed* , and *safely*.\r\n\r\nMy initial thoughts are that we should at very least start by taking stock of the webpack config options that are documented and should not be overridden, and protect those entirely. We also need to put extra protection on certain options that one could use with webpack, but we need to control with spike so that spike can operate correctly. I also would love if the loaders and options you are passing to those loaders could be in the same place, since that just makes sense unlike the current API."}}
{"actor":{"display_login":"jescalan"}}