webpack-contrib / imports-loader

Imports Loader
MIT License
520 stars 63 forks source link

Import literal objects with multiple keys #6

Closed vieron closed 8 years ago

vieron commented 9 years ago

If we can use imports?config=>{foo:true}, using imports?config=>{foo:true,bar:false} should also work. The inner comma is interpreted as a different value for the imports-loader and the result is invalid and unexpected JS code:

var config = {foo:true;
var bar:false}

Any workaround for this?

sokra commented 9 years ago

Technically you need to urlencode it: imports?config=>{foo:true%2Cbar:false}

vieron commented 9 years ago

I ended with imports?config=>require('shims')