index.js 397 B

123456789101112131415
  1. const bsn = require('bootstrap.native/lib/build-module.js')
  2. const { getOptions } = require('loader-utils')
  3. module.exports = function () {
  4. this.cacheable = true
  5. const callback = this.async()
  6. const options = getOptions(this) || {}
  7. options.bs_version = options.bs_version || 4;
  8. bsn(options).then((source) => {
  9. callback(null, source)
  10. }).catch((error) => {
  11. callback(error)
  12. })
  13. }