Created
March 5, 2019 12:15
-
-
Save kmaraz/4c8a5ad82bcadae3e14c94f160a2d290 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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