Files
dspace-angular/webpack/webpack.aot.js
2017-09-26 10:37:54 -05:00

31 lines
631 B
JavaScript

const {
root
} = require('./helpers');
const {
AotPlugin
} = require('@ngtools/webpack');
const tsconfigs = {
client: root('./src/tsconfig.browser.json'),
server: root('./src/tsconfig.server.json')
};
/**
* Generates a AotPlugin for @ngtools/webpack
*
* @param {string} platform Should either be client or server
* @param {boolean} aot Enables/Disables AoT Compilation
* @returns {AotPlugin} Configuration of AotPlugin
*/
function getAotPlugin(platform, aot) {
return new AotPlugin({
tsConfigPath: tsconfigs[platform],
skipCodeGeneration: !aot
});
}
module.exports = {
getAotPlugin: getAotPlugin
};