Angular5 / Webworker - 试图找到引导代码,但不能

时间:2018-03-05 20:14:49

标签: angular5 web-worker

我尝试按照所有这些关于webworker的教程,但没有人工作。这是其中之一:https://blog.angularindepth.com/angular-with-web-workers-step-by-step-dc11d5872135

我一步一步地遵循,但在我运行npm start后,我得到了一个

  

ERROR in Error: Tried to find bootstrap code, but could not. Specify either statically analyzable bootstrap code or pass in an entryModule to the plugins options. at Object.resolveEntryModuleFromMain (D:\PROJECTS_TIQ\w3\worky\node_modules\@ngtools\webpack\src\entry_resolver.js:121:15) at Promise.resolve.then.then (D:\PROJECTS_TIQ\w3\worky\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:240:54) at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7) at Function.Module.runMain (module.js:678:11) at startup (bootstrap_node.js:187:16) at bootstrap_node.js:608:3

这是我的主要内容..我认为问题出在这里,但是什么......?

import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

import { AppModule } from './app/app.module';
import { environment } from './environments/environment';

import { bootstrapWorkerUi } from '@angular/platform-webworker';

if (environment.production) {
  enableProdMode();
}

platformBrowserDynamic().bootstrapWorkerUi('webworker.bunde.js')
  .catch(err => console.log(err));

也..本教程讨论了AotPlugin中应该包含的某种webpack.config.js ..但是当我npm eject时,我没有导入AotPlugin CONFG(?)

0 个答案:

没有答案
相关问题