mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-23 18:37:30 -07:00
20 lines
359 B
TypeScript
20 lines
359 B
TypeScript
/**
|
|
* Replace base64 symbols
|
|
*/
|
|
|
|
import * as fs from 'fs';
|
|
|
|
export default () => ({
|
|
enforce: 'pre',
|
|
test: /\.(vue|js)$/,
|
|
exclude: /node_modules/,
|
|
use: [{
|
|
loader: 'replace-string-loader',
|
|
options: {
|
|
search: /%base64:(.+?)%/g,
|
|
replace: (_, key) => {
|
|
return fs.readFileSync(__dirname + '/../../../src/web/' + key, 'base64');
|
|
}
|
|
}
|
|
}]
|
|
});
|