Javascript 如何删除angular9中未使用的模块js调用

Javascript 如何删除angular9中未使用的模块js调用,javascript,angular,typescript,Javascript,Angular,Typescript,我正在使用一个延迟加载模块。但点击学习路径模块,但另4个模块调用如上图所示(所有访问通行证、未找到页面等) 如何删除未使用的模块js? 每次调用所有模块js。 提前谢谢 app.router.module.js import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; const routes: Routes = [ { path: '', load

我正在使用一个延迟加载模块。但点击学习路径模块,但另4个模块调用如上图所示(所有访问通行证、未找到页面等)

如何删除未使用的模块js? 每次调用所有模块js。 提前谢谢

app.router.module.js

import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';


const routes: Routes = [

  { path: '', loadChildren: () => import('./pages/course-home/course-home.module').then(m => m.CourseHomeModule),  pathMatch: 'full'},

  {
    path: 'all-access-pass', loadChildren: () => import('./pages/all-access-pass/all-access-pass.module').then(m => m.AllAccessPassModule)
  },

  {
    path: 'checkout', loadChildren: () => import('./pages/checkout/checkout.module').then(m => m.CheckoutModule)
  },
{
   path: 'checkout/order-success/:id', loadChildren: () => import('./pages/thank-you/thank-you.module').then(m => m.ThankYouModule)
},
// {
//    path: 'login', loadChildren: () => import('../login/login.module').then(m => m.LoginModule)
// },
{
   path: 'registration', loadChildren: () => import('./pages/registration/registration.module').then(m => m.RegistrationModule)
},
  { path: 'free-trial-create-order', loadChildren: () => import('./pages/free-trial-create-order/free-trial-create-order.module')
  .then(m => m.FreeTrialCreateOrderModule) },
// Free trail Checkout.
  { path: 'all-access-pass-checkout', loadChildren: () => import('./pages/free-trial-checkout/free-trial-checkout.module')
  .then(m => m.FreeTrialCheckoutModule) },

// Free trial ThankYou.
  {
    path: 'all-access-pass-checkout/order-success/:id', loadChildren: () =>
    import('./pages/free-trial-thank-you/free-trial-thank-you.module')
    .then(m => m.FreeTrialThankYouModule)
  },
  { path: '404', loadChildren: () => import('./pages/page-not-found/page-not-found.module').then(m => m.PageNotFoundModule) },
 
  { path: 'all-access-pass-checkout-new', loadChildren: () => import('./pages/free-trial-checkout-variation/free-trial-checkout-variation.module').then(m => m.FreeTrialCheckoutVariationModule) },

  { path: 'all-access-pass-checkout-new/order-success/:id', loadChildren: () => import('./pages/free-trial-variation-thank-you/free-trial-variation-thank-you.module').then(m => m.FreeTrialVariationThankYouModule) },
},

  { path: '**', loadChildren: () => import('./pages/page-not-found/page-not-found.module').then(m => m.PageNotFoundModule) },
];

@NgModule({
  imports: [RouterModule.forRoot(routes, {
    scrollPositionRestoration: 'top'
})],
  exports: [RouterModule]
})

export class AppRoutingModule { }

您指的是:

自动删除TypeScript项目中所有未使用的导入


您指的是:

自动删除TypeScript项目中所有未使用的导入


它不应该加载其他延迟加载模块。实际上,您确定没有在其他位置导入它们吗?创建了一个共享模块。该模块在整个项目中使用,并在其他模块中导入。实际上,它不应该加载其他延迟加载模块,您确定没有在其他位置导入它们吗?创建了一个共享模块。该模块在整个项目中使用,并在其他模块中导入。