mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
31 lines
631 B
JavaScript
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
|
|
};
|