Try to fix image issue

This commit is contained in:
Schoumi 2018-12-06 17:35:26 +01:00
parent 170c206b13
commit cfd6726c27
4 changed files with 31 additions and 2 deletions

View File

@ -46,6 +46,7 @@
"git-directory-deploy": "1.5.1",
"husky": "1.2.0",
"konitor": "0.10.0",
"string-replace-loader": "^2.1.1",
"svgo": "1.1.1",
"webpack": "4.26.0",
"webpack-cli": "3.1.2"

View File

@ -252,7 +252,7 @@ async function getDeclaration(params, periode) {
async function buildDeclarationPDF(data, periode) {
var doc = new pdf.Document()
doc.text('Généré par le connceteur Net-Entreprise (Micro-Entrepreneur)', {
doc.text('Généré par le connecteur Net-Entreprise (Micro-Entrepreneur)', {
font: require('pdfjs/font/Helvetica-Bold'),
fontSize: 9
})

View File

@ -17,6 +17,8 @@ try {
}
const appIconRX = iconName && new RegExp(`[^/]*/${iconName}`)
const base64Image = new Buffer(fs.readFileSync("img.jpg")).toString('base64');
module.exports = {
entry,
target: 'node',
@ -40,7 +42,17 @@ module.exports = {
// WARNING in ../libs/node_modules/bindings/bindings.js 76:22-40
// Critical dependency: the request of a dependency is an expression
// Since we cannot change this dependency. I think it won't hide more important messages
exprContextCritical: false
exprContextCritical: false,
rules: [
{
test: /\.js$/,
loader: 'string-replace-loader',
options: {
search: "fs.readFileSync('img.jpg')",
replace: "Buffer.from('" + base64Image + "', 'base64')",
}
}
]
}
}

View File

@ -6496,6 +6496,14 @@ schema-utils@^0.4.4:
ajv "^6.1.0"
ajv-keywords "^3.1.0"
schema-utils@^0.4.5:
version "0.4.7"
resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-0.4.7.tgz#ba74f597d2be2ea880131746ee17d0a093c68187"
integrity sha512-v/iwU6wvwGK8HbU9yi3/nhGzP0yGSuhQMzL6ySiec1FSrZZDkhm4noOSWzrNFo/jEc+SJY6jRTwuwbSXJPDUnQ==
dependencies:
ajv "^6.1.0"
ajv-keywords "^3.1.0"
schema-utils@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-1.0.0.tgz#0b79a93204d7b600d4b2850d1f66c2a34951c770"
@ -6906,6 +6914,14 @@ strict-uri-encode@^1.0.0:
resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713"
integrity sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=
string-replace-loader@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/string-replace-loader/-/string-replace-loader-2.1.1.tgz#b72e7b57b6ef04efe615aff0ad989b5c14ca63d1"
integrity sha512-0Nvw1LDclF45AFNuYPcD2Jvkv0mwb/dQSnJZMvhqGrT+zzmrpG3OJFD600qfQfNUd5aqfp7fCm2mQMfF7zLbyQ==
dependencies:
loader-utils "^1.1.0"
schema-utils "^0.4.5"
string-width@^1.0.1, string-width@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"