mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2024-11-19 07:26:28 +01:00
20 lines
433 B
TypeScript
20 lines
433 B
TypeScript
|
/**
|
||
|
* Replace base64 symbols
|
||
|
*/
|
||
|
|
||
|
import * as fs from 'fs';
|
||
|
const StringReplacePlugin = require('string-replace-webpack-plugin');
|
||
|
|
||
|
export default () => ({
|
||
|
enforce: 'pre',
|
||
|
test: /\.(tag|js)$/,
|
||
|
exclude: /node_modules/,
|
||
|
loader: StringReplacePlugin.replace({
|
||
|
replacements: [{
|
||
|
pattern: /%base64:(.+?)%/g, replacement: (_, key) => {
|
||
|
return fs.readFileSync(__dirname + '/../../../src/web/' + key, 'base64');
|
||
|
}
|
||
|
}]
|
||
|
})
|
||
|
});
|