{"library":"promise-loader","title":"promise-loader","description":"A Webpack loader that provides a promise-based alternative to bundle-loader for code splitting. It wraps lazy-loaded chunks behind a function that returns a Promise<module>, allowing you to control when the chunk is fetched. The loader requires a promise library parameter (e.g., 'bluebird', 'Q', or 'global'). Supports named chunks and filename/name substitutions in bundle names. Stable version 1.0.0, by Dan Abramov. Useful for single-page apps needing promise-based lazy loading with Webpack.","language":"javascript","status":"maintenance","last_verified":"Sat Apr 25","install":{"commands":["npm install promise-loader"],"cli":null},"imports":["const load = require('promise?bluebird!./file.js');","const load = require('promise?bluebird,editor!./editor.js');","{ test: /\\.i18n\\.json$/, loader: 'promise?global,[name].i18n' }"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"// webpack.config.js\nmodule.exports = {\n  entry: './index.js',\n  output: {\n    filename: 'bundle.js',\n    path: __dirname + '/dist'\n  },\n  module: {\n    loaders: [\n      {\n        test: /\\.async\\.js$/,\n        loader: 'promise?bluebird'\n      }\n    ]\n  }\n};\n\n// index.js\nvar load = require('./some.async.js');\nload().then(function(module) {\n  console.log(module);\n}).catch(function(err) {\n  console.error(err);\n});","lang":"javascript","description":"This shows how to configure promise-loader in Webpack to load files ending with .async.js lazily using Bluebird promises.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}