2017-10-22 00:11:28 -05:00
|
|
|
/**
|
|
|
|
* Replace base64 symbols
|
|
|
|
*/
|
|
|
|
|
|
|
|
import * as fs from 'fs';
|
|
|
|
|
|
|
|
export default () => ({
|
|
|
|
enforce: 'pre',
|
2018-02-12 22:18:03 -06:00
|
|
|
test: /\.(vue|js)$/,
|
2017-10-22 00:11:28 -05:00
|
|
|
exclude: /node_modules/,
|
2018-02-15 08:07:19 -06:00
|
|
|
loader: 'string-replace-loader',
|
|
|
|
query: {
|
|
|
|
search: /%base64:(.+?)%/g,
|
|
|
|
replace: (_, key) => {
|
|
|
|
return fs.readFileSync(__dirname + '/../../../src/web/' + key, 'base64');
|
2018-02-15 04:59:07 -06:00
|
|
|
}
|
2018-02-15 08:07:19 -06:00
|
|
|
}
|
2017-10-22 00:11:28 -05:00
|
|
|
});
|