How to use the @ngtools/webpack.AotPlugin 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 aguskov1987 / arango-graphit / webpack.config.js View on Github external
},
      "lessLoader": {
        "sourceMap": false
      },
      "context": ""
    }
  }));

  if (isProd) {
    plugins.push(new HashedModuleIdsPlugin({
      "hashFunction": "md5",
      "hashDigest": "base64",
      "hashDigestLength": 4
    }));

    plugins.push(new AotPlugin({
      "mainPath": "main.ts",
      "hostReplacementPaths": {
        "environments/index.ts": "environments/index.prod.ts"
      },
      "exclude": [],
      "tsConfigPath": "src/tsconfig.app.json"
    }));

    // plugins.push(new UglifyJsPlugin({
    //   "mangle": {
    //     "screw_ie8": true
    //   },
    //   "compress": {
    //     "screw_ie8": true,
    //     "warnings": false
    //   },
github saxsys / Saxonia-Campus-Angular / webpack.config.js View on Github external
// Also dedupe multiple slashes into single ones.
                return `/${baseHref || ''}/${deployUrl || ''}/${URL}`.replace(/\/\/+/g, '/');
              }
            })
          ],
          "sassLoader": {
            "sourceMap": false,
            "includePaths": []
          },
          "lessLoader": {
            "sourceMap": false
          },
          "context": ""
        }
      }),
      new AotPlugin({
        "mainPath": "main.ts",
        "exclude": [],
        "tsConfigPath": "src/tsconfig.app.json",
        "skipCodeGeneration": env.aot
      }),
      new NormalModuleReplacementPlugin(
        /environments\/environment/,
        env.env && env.env != 'dev' ? resolve('src', `environments/environment.${env.env}.ts`) : resolve('src', "environments/environment.ts")
      )
    ],
    "node": {
      "fs": "empty",
      "global": true,
      "crypto": "empty",
      "tls": "empty",
      "net": "empty",
github avg-plus / avg.renderer / webpack.config.js View on Github external
context: ""
      }
    })
  );

  if (isProd) {
    // plugins.push(
    //   new HashedModuleIdsPlugin({
    //     hashFunction: "md5",
    //     hashDigest: "base64",
    //     hashDigestLength: 4
    //   })
    // );

    plugins.push(
      new AotPlugin({
        mainPath: "main.ts",
        hostReplacementPaths: {
          "environments/index.ts": "environments/index.prod.ts"
        },
        exclude: [],
        tsConfigPath: "src/tsconfig.app.json",
        skipCodeGeneration: true
      })
    );

    // plugins.push(
    //   new UglifyJsPlugin({
    //     test: /\.js($|\?)/i
    //   })
    // );
  } else {
github fossasia / susper.com / node_modules / @angular / cli / models / webpack-configs / typescript.js View on Github external
return new webpack_1.AngularCompilerPlugin(pluginOptions);
    }
    else {
        const pluginOptions = Object.assign({}, {
            mainPath: path.join(projectRoot, appConfig.root, appConfig.main),
            i18nFile: buildOptions.i18nFile,
            i18nFormat: buildOptions.i18nFormat,
            locale: buildOptions.locale,
            replaceExport: appConfig.platform === 'server',
            missingTranslation: buildOptions.missingTranslation,
            hostReplacementPaths,
            sourceMap: buildOptions.sourcemaps,
            // If we don't explicitely list excludes, it will default to `['**/*.spec.ts']`.
            exclude: []
        }, options);
        return new webpack_1.AotPlugin(pluginOptions);
    }
}
function getNonAotConfig(wco) {
github matt4446 / WhatsMyScore2-NativeScript / webpack.config.js View on Github external
{ from: mainSheet },
            { from: "css/**" },
            { from: "fonts/**" },
            { from: "**/*.jpg" },
            { from: "**/*.png" },
            { from: "**/*.xml" },
        ], { ignore: ["App_Resources/**"] }),

        // Generate a bundle starter script and activate it in package.json
        new nsWebpack.GenerateBundleStarterPlugin([
            "./vendor",
            "./bundle",
        ]),

        // Angular AOT compiler
        new AotPlugin({
            tsConfigPath: "tsconfig.aot.json",
            entryModule: resolve(__dirname, "app/app.module#AppModule"),
            typeChecking: false
        }),

        // Resolve .ios.css and .android.css component stylesheets
        new nsWebpack.StyleUrlResolvePlugin({platform}),

    ];
    
    if (env.uglify) {
        plugins.push(new webpack.LoaderOptionsPlugin({ minimize: true }));

        // Work around an Android issue by setting compress = false
        const compress = platform !== "android";
        plugins.push(new webpack.optimize.UglifyJsPlugin({
github Mindmapp / mindmapp / webpack.config.js View on Github external
"tsConfigPath": "src/tsconfig.app.json"
        }));

        plugins.push(new UglifyJsPlugin({
            "mangle": {
                "screw_ie8": true
            },
            "compress": {
                "screw_ie8": true,
                "warnings": false
            },
            "sourceMap": false
        }));

    } else {
        plugins.push(new AotPlugin({
            "mainPath": "main.ts",
            "hostReplacementPaths": {
                "environments/index.ts": "environments/index.ts"
            },
            "exclude": [],
            "tsConfigPath": "src/tsconfig.app.json",
            "skipCodeGeneration": true
        }));
    }

    return plugins;
}
github camargo / ng-seed / config / webpack.prod.js View on Github external
name: 'polyfills'
    }),

    new HtmlWebpackPlugin({
      template: './src/index.html'
    }),

    new webpack.DefinePlugin({
      'process.env': {
        'ENV': JSON.stringify('production')
      }
    })
  ]
};

webpackProdConfig.plugins.push(new ngToolsWebpack.AotPlugin({
  tsConfigPath: helpers.root('tsconfig.prod.json'),
  entryModule: helpers.root('src' , 'app', 'app.module#AppModule'),
  mainPath: helpers.root('src', 'browser.main.ts')
}));

module.exports = webpackProdConfig;
github mattlewis92 / angular2-tv-tracker / webpack.config.ts View on Github external
}
      }, {
        test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
        loader: 'file-loader'
      }])
    },
    resolve: {
      extensions: ['.ts', '.js']
    },
    devServer: {
      port: 8000,
      inline: true
    },
    plugins: removeEmpty([
      ifDevelopment(new ForkTsCheckerWebpackPlugin()),
      ifProduction(new AotPlugin({
        tsConfigPath: './tsconfig-aot.json'
      })),
      ifProduction(new webpack.optimize.UglifyJsPlugin({sourceMap: true})),
      new webpack.DefinePlugin({
        ENV: JSON.stringify(environment)
      }),
      extractCSS,
      new webpack.ContextReplacementPlugin(
        /angular(\\|\/)core(\\|\/)esm5/,
        __dirname + '/src'
      ),
      new webpack.optimize.CommonsChunkPlugin({
        name: 'main',
        async: true,
        minChunks: 2
      }),