mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
Fixed AoT Build
This commit is contained in:
@@ -3,7 +3,7 @@ const {
|
||||
} = require('./helpers');
|
||||
|
||||
const {
|
||||
AotPlugin
|
||||
AngularCompilerPlugin
|
||||
} = require('@ngtools/webpack');
|
||||
|
||||
const tsconfigs = {
|
||||
@@ -11,6 +11,11 @@ const tsconfigs = {
|
||||
server: root('./src/tsconfig.server.json')
|
||||
};
|
||||
|
||||
const aotTsconfigs = {
|
||||
client: root('./src/tsconfig.browser.json'),
|
||||
server: root('./src/tsconfig.server.aot.json')
|
||||
};
|
||||
|
||||
/**
|
||||
* Generates a AotPlugin for @ngtools/webpack
|
||||
*
|
||||
@@ -19,8 +24,8 @@ const tsconfigs = {
|
||||
* @returns {AotPlugin} Configuration of AotPlugin
|
||||
*/
|
||||
function getAotPlugin(platform, aot) {
|
||||
return new AotPlugin({
|
||||
tsConfigPath: tsconfigs[platform],
|
||||
return new AngularCompilerPlugin({
|
||||
tsConfigPath: aot ? aotTsconfigs[platform] : tsconfigs[platform],
|
||||
skipCodeGeneration: !aot
|
||||
});
|
||||
}
|
||||
|
@@ -5,15 +5,20 @@ const {
|
||||
} = require('./helpers');
|
||||
|
||||
module.exports = {
|
||||
entry: root('./src/main.server.ts'),
|
||||
output: {
|
||||
filename: 'server.js'
|
||||
},
|
||||
target: 'node',
|
||||
externals: [nodeExternals({
|
||||
whitelist: [
|
||||
/@angular/,
|
||||
/@ng/,
|
||||
/ngx/]
|
||||
})],
|
||||
getServerWebpackPartial: function (aot) {
|
||||
const entry = aot ? root('./src/main.server.aot.ts') : root('./src/main.server.ts');
|
||||
return {
|
||||
entry: entry,
|
||||
output: {
|
||||
filename: 'server.js'
|
||||
},
|
||||
target: 'node',
|
||||
externals: [nodeExternals({
|
||||
whitelist: [
|
||||
/@angular/,
|
||||
/@ng/,
|
||||
/ngx/]
|
||||
})],
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user