Skip to content

Support Webpack Prefetch #163

@namelos

Description

@namelos

I'm submitting a feature request

We're porting a reasonably sized repo (the Aurelia app takes 100k sloc) from AureliaCLI (vanilla RequireJS / Gulp) to Webpack with this Plugin, I made everything works already (Many thanks for the plugin itself and the helpful yet brief wiki!).

We had some hand-rolled solutions that would prefetch with RequireJS bundles before because the loading speed is kind of essential to us, and Webpack support this already:

import(/* webpackPrefetch: true */ 'LoginModal');

The approach is just a dynamic import with magical comments. However, with Aurelia, I could only import modules with PLATFORM.moduleName('./foo-module', 'foo-chunk').

I tried to figure out if there's a straightforward way to do it. But if I get it right, It seems the IncludeDependency only support two arguments: the module name and the chunk it belongs to.

Is there any way to achieve this? Furthermore, there seem to be some other useful options like preload could be expressed with the magical comment, is it possible to support those with PLATFORM.moduleName? Could the behavior and lazy loading share with the<require></require> in templates?

Thank again for the great plugin.

Expected/desired behavior:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions