{"action":"created","issue":{"url":"https://api.github.com/repos/webpack/webpack/issues/1571","labels_url":"https://api.github.com/repos/webpack/webpack/issues/1571/labels{/name}","comments_url":"https://api.github.com/repos/webpack/webpack/issues/1571/comments","events_url":"https://api.github.com/repos/webpack/webpack/issues/1571/events","html_url":"https://github.com/webpack/webpack/issues/1571","id":114397658,"number":1571,"title":"Idea: text-based macro preprocessor loader","user":{"login":"jedwards1211","id":1448194,"avatar_url":"https://avatars.githubusercontent.com/u/1448194?v=3","gravatar_id":"","url":"https://api.github.com/users/jedwards1211","html_url":"https://github.com/jedwards1211","followers_url":"https://api.github.com/users/jedwards1211/followers","following_url":"https://api.github.com/users/jedwards1211/following{/other_user}","gists_url":"https://api.github.com/users/jedwards1211/gists{/gist_id}","starred_url":"https://api.github.com/users/jedwards1211/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jedwards1211/subscriptions","organizations_url":"https://api.github.com/users/jedwards1211/orgs","repos_url":"https://api.github.com/users/jedwards1211/repos","events_url":"https://api.github.com/users/jedwards1211/events{/privacy}","received_events_url":"https://api.github.com/users/jedwards1211/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-31T08:24:00Z","updated_at":"2015-10-31T16:52:07Z","closed_at":null,"body":"Upon reading https://github.com/jtangelder/sass-loader/issues/181 and reading about how Sassport enables one to share variables between Sass and JS, I realized an ideal solution might go much deeper.   Why not have a way to share variables and even computed values between files of any type?\r\n\r\nObviously it's something that could be done fairly easy with a webpack loader.  Imagine macros that invoke JS functions and get replaced with the return value!\r\n\r\nI figure such a loader must exist already, but I haven't found one yet.  Does anyone know?\r\n\r\nThe main difficulty would be that the macro syntax would have to vary depending on the file being loaded.  But that might not be such a huge problem; users could specify what kind of macro escape chars they want in the loader config."},"comment":{"url":"https://api.github.com/repos/webpack/webpack/issues/comments/152748792","html_url":"https://github.com/webpack/webpack/issues/1571#issuecomment-152748792","issue_url":"https://api.github.com/repos/webpack/webpack/issues/1571","id":152748792,"user":{"login":"IngwiePhoenix","id":2893716,"avatar_url":"https://avatars.githubusercontent.com/u/2893716?v=3","gravatar_id":"","url":"https://api.github.com/users/IngwiePhoenix","html_url":"https://github.com/IngwiePhoenix","followers_url":"https://api.github.com/users/IngwiePhoenix/followers","following_url":"https://api.github.com/users/IngwiePhoenix/following{/other_user}","gists_url":"https://api.github.com/users/IngwiePhoenix/gists{/gist_id}","starred_url":"https://api.github.com/users/IngwiePhoenix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IngwiePhoenix/subscriptions","organizations_url":"https://api.github.com/users/IngwiePhoenix/orgs","repos_url":"https://api.github.com/users/IngwiePhoenix/repos","events_url":"https://api.github.com/users/IngwiePhoenix/events{/privacy}","received_events_url":"https://api.github.com/users/IngwiePhoenix/received_events","type":"User","site_admin":false},"created_at":"2015-10-31T16:52:07Z","updated_at":"2015-10-31T16:52:07Z","body":"I had thought of creating a C-like preprocessor loader for Webpack too. But I suck at writing stuff like that. :)\r\n\r\nWhat I did instead is... https://github.com/IngwiePhoenix/sassport-loader"}}