mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-16 14:33:03 +00:00
fixed build with latest dependencies
This commit is contained in:
@@ -1,57 +0,0 @@
|
||||
const webpackMerge = require('webpack-merge');
|
||||
const commonPartial = require('./webpack/webpack.common');
|
||||
const clientPartial = require('./webpack/webpack.client');
|
||||
const serverPartial = require('./webpack/webpack.server');
|
||||
const prodPartial = require('./webpack/webpack.prod');
|
||||
|
||||
const {
|
||||
AotPlugin
|
||||
} = require('@ngtools/webpack');
|
||||
|
||||
const {
|
||||
root
|
||||
} = require('./webpack/helpers');
|
||||
|
||||
module.exports = function(options, webpackOptions) {
|
||||
options = options || {};
|
||||
|
||||
if (options.aot) {
|
||||
console.log(`Running build for ${options.client ? 'client' : 'server'} with AoT Compilation`)
|
||||
}
|
||||
|
||||
let serverConfig = webpackMerge({}, commonPartial, serverPartial, {
|
||||
entry: options.aot ? './src/main.server.aot.ts' : serverPartial.entry, // Temporary
|
||||
plugins: [
|
||||
new AotPlugin({
|
||||
tsConfigPath: root(options.aot ? './src/tsconfig.server.aot.json' : './src/tsconfig.server.json'),
|
||||
skipCodeGeneration: !options.aot
|
||||
})
|
||||
]
|
||||
});
|
||||
|
||||
let clientConfig = webpackMerge({}, commonPartial, clientPartial, {
|
||||
plugins: [
|
||||
new AotPlugin({
|
||||
tsConfigPath: root('./src/tsconfig.browser.json'),
|
||||
skipCodeGeneration: !options.aot
|
||||
})
|
||||
]
|
||||
});
|
||||
|
||||
if (webpackOptions.p) {
|
||||
serverConfig = webpackMerge({}, serverConfig, prodPartial);
|
||||
clientConfig = webpackMerge({}, clientConfig, prodPartial);
|
||||
}
|
||||
|
||||
const configs = [];
|
||||
|
||||
if (!options.aot) {
|
||||
configs.push(clientConfig, serverConfig);
|
||||
} else if (options.client) {
|
||||
configs.push(clientConfig);
|
||||
} else if (options.server) {
|
||||
configs.push(serverConfig);
|
||||
}
|
||||
|
||||
return configs;
|
||||
}
|
Reference in New Issue
Block a user