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,18 +1,41 @@
|
|||||||
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
const fs = require('fs');
|
||||||
const {
|
const {
|
||||||
projectRoot,
|
projectRoot,
|
||||||
buildRoot,
|
buildRoot,
|
||||||
globalCSSImports,
|
globalCSSImports,
|
||||||
|
theme,
|
||||||
themePath,
|
themePath,
|
||||||
themedTest,
|
themedTest,
|
||||||
themedUse
|
themedUse
|
||||||
} = require('./helpers');
|
} = require('./helpers');
|
||||||
|
|
||||||
module.exports = (env) => {
|
module.exports = (env) => {
|
||||||
return {
|
let copyWebpackOptions = [{
|
||||||
mode: 'development',
|
from: path.join(__dirname, '..', 'node_modules', '@fortawesome', 'fontawesome-free', 'webfonts'),
|
||||||
devtool: 'source-map',
|
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',
|
||||||
resolve: {
|
resolve: {
|
||||||
extensions: ['.ts', '.js', '.json']
|
extensions: ['.ts', '.js', '.json']
|
||||||
},
|
},
|
||||||
@@ -144,17 +167,7 @@ module.exports = (env) => {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
new CopyWebpackPlugin([{
|
new CopyWebpackPlugin(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')
|
|
||||||
}
|
|
||||||
])
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user