1.0.1 • Published 6 years ago

asm-async-loader v1.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

npm node deps

npm install --save-dev npm-async-loader

Use the loader either via your webpack config, CLI or inline.

Via webpack config (recommended)

webpack.config.js

module.exports = {
  module: {
    rules: [
      {
        test: /\.js$/,
        use: 'asm-async-loader'
      }
    ]
  }
}

In your application

import promise from './asm-script.js';

promise
    .then(function() {
        //your script usage
    })
    .catch(function(err) {
        //script loading failed
    });

Inline

In your application

import promise from 'asm-async-loader!./asm-script.js';

promise
    .then(function() {
        //your script usage
    })
    .catch(function(err) {
        //script loading failed
    });
1.0.1

6 years ago

1.0.0

6 years ago