mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-24 04:59:06 +01:00
22 lines
445 B
TypeScript
22 lines
445 B
TypeScript
/**
|
|
* Replace i18n texts
|
|
*/
|
|
|
|
const StringReplacePlugin = require('string-replace-webpack-plugin');
|
|
import Replacer from '../../../src/common/build/i18n';
|
|
|
|
export default lang => {
|
|
const replacer = new Replacer(lang);
|
|
|
|
return {
|
|
enforce: 'pre',
|
|
test: /\.(tag|js|ts)$/,
|
|
exclude: /node_modules/,
|
|
loader: StringReplacePlugin.replace({
|
|
replacements: [{
|
|
pattern: replacer.pattern, replacement: replacer.replacement
|
|
}]
|
|
})
|
|
};
|
|
};
|