Skip to content

Instantly share code, notes, and snippets.

@kmaraz
Created March 5, 2019 12:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kmaraz/4c8a5ad82bcadae3e14c94f160a2d290 to your computer and use it in GitHub Desktop.
Save kmaraz/4c8a5ad82bcadae3e14c94f160a2d290 to your computer and use it in GitHub Desktop.
const path = require('path');
const AngularCompilerPlugin = require('@ngtools/webpack').AngularCompilerPlugin;
module.exports = (env, argv) => {
const config = {
plugins: [
// See: https://www.npmjs.com/package/@ngtools/webpack
new AngularCompilerPlugin({
// We wanted to have separate tsconfig for AOT compilation
tsConfigPath: path.join(__dirname, 'tsconfig.aot.json'),
mainPath: path.join(__dirname, 'app/index'),
entryModule: path.join(__dirname, 'app/app.module#AppModule'),
sourceMap: true
})
],
module: {
rules: [{
test: /(\.ngfactory\.js|\.ngstyle\.js|\.ts)$/,
use: [
'@ngtools/webpack'
],
exclude: [/node_modules/]
}]
}
};
return config;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment