Skip to content

Instantly share code, notes, and snippets.

@chlab
Last active July 4, 2016 11:14
Show Gist options
  • Save chlab/fe7b8b4116fe79121035107be7e8b2ad to your computer and use it in GitHub Desktop.
Save chlab/fe7b8b4116fe79121035107be7e8b2ad to your computer and use it in GitHub Desktop.
// in webpack.config.js
module: {
loaders: [
{
test: require.resolve('blueimp-bootstrap-image-gallery/js/bootstrap-image-gallery'),
loader: 'imports?define=>false,blueimp=blueimp-gallery'
},
{
test: require.resolve('blueimp-gallery'),
loader: 'imports?define=>false'
}
]
}
// in your module
import 'blueimp-bootstrap-image-gallery/js/bootstrap-image-gallery.js';
import blueimp from 'exports?window.blueimp!blueimp-gallery'
@chlab
Copy link
Author

chlab commented Jul 4, 2016

Overrides blueimp-image-gallery's relative requiring by telling it not to do amd and just export itself as blueimp.
See stackoverflow question.

You will need to npm install imports-loader exports-loader --save

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment