How to use the @ngtools/webpack/src/compiler_host.WebpackCompilerHost function in @ngtools/webpack

To help you get started, we’ve selected a few @ngtools/webpack examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github shlomiassaf / ngc-webpack / test / lib-usage.spec.ts View on Github external
it('should run with library config', async () => {
    const WebpackCompilerHost = require('@ngtools/webpack/src/compiler_host').WebpackCompilerHost;
    const writeFilePropertyDescriptor = Object.getOwnPropertyDescriptor(WebpackCompilerHost.prototype, 'writeFile');

    try {
      NgcWebpackPlugin = require('../dist').NgcWebpackPlugin;
      findPluginIndex = require('../dist/src/cli/cli').findPluginIndex;
      require('../dist/src/patch-ngtools-compiler-host-for-flat-module');
    } catch (e) {
      NgcWebpackPlugin = require('../index').NgcWebpackPlugin;
      findPluginIndex = require('../src/cli/cli').findPluginIndex;
      require('../src/patch-ngtools-compiler-host-for-flat-module');
    }

    delOutDir();

    const tmpTsConfig = await createTempTsConfig( config => {
      return Object.assign(config, {