aurelia-loader-webpack

  • Version 2.2.2
  • Published
  • 145 kB
  • 4 dependencies
  • MIT license

Install

npm i aurelia-loader-webpack
yarn add aurelia-loader-webpack
pnpm add aurelia-loader-webpack

Overview

An implementation of Aurelia's loader interface to enable webpack.

Index

Functions

function ensureOriginOnExports

ensureOriginOnExports: (moduleExports: any, moduleId: string) => any;

    Classes

    class TextTemplateLoader

    class TextTemplateLoader {}
    • An implementation of the TemplateLoader interface implemented with text-based loading.

    method loadTemplate

    loadTemplate: (loader: any, entry: any) => Promise<void>;
    • Loads a template.

      Parameter loader

      The loader that is requesting the template load.

      Parameter entry

      The TemplateRegistryEntry to load and populate with a template. A promise which resolves when the TemplateRegistryEntry is loaded with a template.

    class WebpackLoader

    class WebpackLoader extends Loader {}
    • A default implementation of the Loader abstraction which works with webpack (extended common-js style).

    constructor

    constructor();

      property hmrContext

      hmrContext: {
      handleModuleChange(
      moduleId: string,
      hot: Webpack.WebpackHotModule
      ): Promise<void>;
      handleViewChange(moduleId: string): Promise<void>;
      };

        property loaderPlugins

        loaderPlugins: { [name: string]: any };

          property moduleRegistry

          moduleRegistry: any;

            property modulesBeingLoaded

            modulesBeingLoaded: Map<string, Promise<any>>;

              property templateLoader

              templateLoader: TextTemplateLoader;

                method addPlugin

                addPlugin: (pluginName: string, implementation: any) => void;
                • Registers a plugin with the loader.

                  Parameter pluginName

                  The name of the plugin.

                  Parameter implementation

                  The plugin implementation.

                method applyPluginToUrl

                applyPluginToUrl: (url: string, pluginName: string) => string;
                • Alters a module id so that it includes a plugin loader.

                  Parameter url

                  The url of the module to load.

                  Parameter pluginName

                  The plugin to apply to the module id. The plugin-based module id.

                method loadAllModules

                loadAllModules: (ids: Array<string>) => Promise<any[]>;
                • Loads a collection of modules.

                  Parameter ids

                  The set of module ids to load. A Promise for an array of loaded modules.

                method loadModule

                loadModule: (moduleId: string, defaultHMR?: boolean) => Promise<any>;
                • Loads a module.

                  Parameter moduleId

                  The module ID to load. A Promise for the loaded module.

                method loadTemplate

                loadTemplate: (url: string) => Promise<any>;
                • Loads a template.

                  Parameter url

                  The url of the template to load. A Promise for a TemplateRegistryEntry containing the template.

                method loadText

                loadText: (url: string) => Promise<any>;
                • Loads a text-based resource.

                  Parameter url

                  The url of the text file to load. A Promise for text content.

                method map

                map: (id: string, source: any) => void;
                • Maps a module id to a source.

                  Parameter id

                  The module id.

                  Parameter source

                  The source to map the module to.

                method normalize

                normalize: (moduleId: string, relativeTo: string) => Promise<string>;
                • Normalizes a module id.

                  Parameter moduleId

                  The module id to normalize.

                  Parameter relativeTo

                  What the module id should be normalized relative to. The normalized module id.

                method normalizeSync

                normalizeSync: (moduleId: string, relativeTo: string) => string;
                • Normalizes a module id.

                  Parameter moduleId

                  The module id to normalize.

                  Parameter relativeTo

                  What the module id should be normalized relative to. The normalized module id.

                method useTemplateLoader

                useTemplateLoader: (templateLoader: TextTemplateLoader) => void;
                • Instructs the loader to use a specific TemplateLoader instance for loading templates

                  Parameter templateLoader

                  The instance of TemplateLoader to use for loading templates.

                Type Aliases

                type LoaderPlugin

                type LoaderPlugin = {
                fetch: (
                address: string
                ) => Promise<TemplateRegistryEntry> | TemplateRegistryEntry;
                };

                  Package Files (1)

                  Dependencies (4)

                  Dev Dependencies (4)

                  Peer Dependencies (0)

                  No peer dependencies.

                  Badge

                  To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                  You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/aurelia-loader-webpack.

                  • Markdown
                    [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/aurelia-loader-webpack)
                  • HTML
                    <a href="https://www.jsdocs.io/package/aurelia-loader-webpack"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>