Web.Client: added webpack config for moving translation resources
This commit is contained in:
parent
5f878e4537
commit
eea51947d3
23
web/ASC.Web.Client/config-overrides.js
Normal file
23
web/ASC.Web.Client/config-overrides.js
Normal file
@ -0,0 +1,23 @@
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||
const path = require('path');
|
||||
module.exports = (config) => {
|
||||
|
||||
config.plugins.push(
|
||||
new CopyWebpackPlugin(
|
||||
[
|
||||
{
|
||||
from: path.join('src', path.sep, 'components', path.sep, '**', path.sep, 'locales', path.sep, '**'),
|
||||
to: 'locales',
|
||||
transformPath(targetPath) {
|
||||
const reversedArrayOfFolders = path.dirname(targetPath).split(path.sep).reverse();
|
||||
const localePath = reversedArrayOfFolders.pop();
|
||||
const finalPath = path.join(path.sep, localePath, path.sep, reversedArrayOfFolders[2], path.sep, reversedArrayOfFolders[0], path.sep, path.basename(targetPath));
|
||||
return finalPath;
|
||||
},
|
||||
}
|
||||
]
|
||||
)
|
||||
);
|
||||
|
||||
return config;
|
||||
}
|
Loading…
Reference in New Issue
Block a user