Skip to content

paztis/asm-async-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

npm node deps

ASM Async Loader

A loader for webpack that lets you import asm scripts in async mode to let the browser do async compilation.

Install

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

Usage

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
    });

About

Async loader of asm scripts for Webpack

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published