mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
Add support for resources in themes
This commit is contained in:
@@ -1,15 +1,38 @@
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const {
|
||||
projectRoot,
|
||||
buildRoot,
|
||||
globalCSSImports,
|
||||
theme,
|
||||
themePath,
|
||||
themedTest,
|
||||
themedUse
|
||||
} = require('./helpers');
|
||||
|
||||
module.exports = (env) => {
|
||||
let copyWebpackOptions = [{
|
||||
from: path.join(__dirname, '..', 'node_modules', '@fortawesome', 'fontawesome-free', 'webfonts'),
|
||||
to: path.join('assets', 'fonts')
|
||||
}, {
|
||||
from: path.join(__dirname, '..', 'resources', 'images'),
|
||||
to: path.join('assets', 'images')
|
||||
}, {
|
||||
from: path.join(__dirname, '..', 'resources', 'i18n'),
|
||||
to: path.join('assets', 'i18n')
|
||||
}
|
||||
];
|
||||
|
||||
const themeImages = path.join(themePath, 'resources', 'images');
|
||||
if(theme && fs.existsSync(themeImages)) {
|
||||
copyWebpackOptions.push({
|
||||
from: themeImages,
|
||||
to: path.join('assets', 'images') ,
|
||||
force: true,
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
mode: 'development',
|
||||
devtool: 'source-map',
|
||||
@@ -144,17 +167,7 @@ module.exports = (env) => {
|
||||
]
|
||||
},
|
||||
plugins: [
|
||||
new CopyWebpackPlugin([{
|
||||
from: path.join(__dirname, '..', 'node_modules', '@fortawesome', 'fontawesome-free', 'webfonts'),
|
||||
to: path.join('assets', 'fonts')
|
||||
}, {
|
||||
from: path.join(__dirname, '..', 'resources', 'images'),
|
||||
to: path.join('assets', 'images')
|
||||
}, {
|
||||
from: path.join(__dirname, '..', 'resources', 'i18n'),
|
||||
to: path.join('assets', 'i18n')
|
||||
}
|
||||
])
|
||||
new CopyWebpackPlugin(copyWebpackOptions)
|
||||
]
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user