mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-24 10:40:23 +00:00
Add '-loader' suffix to all Webpack loader references
This commit is contained in:
committed by
Steve Sanderson
parent
bbbcb5ef18
commit
3a4936dbf7
@@ -20,13 +20,13 @@ class AppRootViewModel {
|
||||
this.route = this._router.currentRoute;
|
||||
|
||||
// Load and register all the KO components needed to handle the routes
|
||||
// The optional 'bundle?lazy!' prefix is a Webpack feature that causes the referenced modules
|
||||
// The optional 'bundle-loader?lazy!' prefix is a Webpack feature that causes the referenced modules
|
||||
// to be split into separate files that are then loaded on demand.
|
||||
// For docs, see https://github.com/webpack/bundle-loader
|
||||
ko.components.register('nav-menu', navMenu);
|
||||
ko.components.register('home-page', require('bundle?lazy!../home-page/home-page'));
|
||||
ko.components.register('counter-example', require('bundle?lazy!../counter-example/counter-example'));
|
||||
ko.components.register('fetch-data', require('bundle?lazy!../fetch-data/fetch-data'));
|
||||
ko.components.register('home-page', require('bundle-loader?lazy!../home-page/home-page'));
|
||||
ko.components.register('counter-example', require('bundle-loader?lazy!../counter-example/counter-example'));
|
||||
ko.components.register('fetch-data', require('bundle-loader?lazy!../fetch-data/fetch-data'));
|
||||
}
|
||||
|
||||
// To support hot module replacement, this method unregisters the router and KO components.
|
||||
|
||||
@@ -2,7 +2,7 @@ import * as ko from 'knockout';
|
||||
|
||||
// This Knockout component loader integrates with Webpack's lazy-loaded bundle feature.
|
||||
// Having this means you can optionally declare components as follows:
|
||||
// ko.components.register('my-component', require('bundle?lazy!../some-path-to-a-js-or-ts-module'));
|
||||
// ko.components.register('my-component', require('bundle-loader?lazy!../some-path-to-a-js-or-ts-module'));
|
||||
// ... and then it will be loaded on demand instead of being loaded up front.
|
||||
ko.components.loaders.unshift({
|
||||
loadComponent: (name, componentConfig, callback) => {
|
||||
|
||||
Reference in New Issue
Block a user