mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
fixed build with latest dependencies
This commit is contained in:
50
webpack.config.js
Normal file
50
webpack.config.js
Normal file
@@ -0,0 +1,50 @@
|
||||
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 {
|
||||
getAotPlugin
|
||||
} = require('./webpack/webpack.aot');
|
||||
|
||||
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, {
|
||||
plugins: [
|
||||
getAotPlugin('server', !!options.aot)
|
||||
]
|
||||
});
|
||||
|
||||
let clientConfig = webpackMerge({}, commonPartial, clientPartial, {
|
||||
plugins: [
|
||||
getAotPlugin('client', !!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