The replace
property is not mandatory anymore (#57)
#86
The replace
property is not mandatory anymore (#57)
#86
Conversation
@LasaleFamine, thanks for your PR! By analyzing the history of the files in this pull request, we identified @StefanoMagrassi to be a potential reviewer. |
1 similar comment
return new Promise((resolve, reject) => { | ||
try { | ||
const changedCSS = replaceInFile.sync(optionCSS); | ||
const changedJS = replaceInFile.sync(optionJS); | ||
const changedCSS = replaceInFile.sync(optionCSS.files ? optionCSS : defaultOptions); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LasaleFamine maybe you can use Ramda's merge method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discuss, we can introduce new logic (and libs) during the refactor.
const changedCSS = replaceInFile.sync(optionCSS); | ||
const changedJS = replaceInFile.sync(optionJS); | ||
const changedCSS = replaceInFile.sync(optionCSS.files ? optionCSS : defaultOptions); | ||
const changedJS = replaceInFile.sync(optionJS.files ? optionJS : defaultOptions); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LasaleFamine same as previous comment
test/index.test.js
Outdated
@@ -115,6 +115,18 @@ test('replace() products correct output', async t => { | |||
t.is(fileReplace, `<!DOCTYPE html><html><head>\n <meta charset=\"utf-8\">\n <title></title>\n\n \n <link rel=\"stylesheet\" href=\"/assets/style.css\">\n \n\n \n <script src=\"/assets/javascript.js\"></script>\n \n\n </head>\n <body>\n\n \n\n</body></html>`); | |||
}); | |||
|
|||
test('when running replace() the "replace" property of configuration is not mandatory', async t => { | |||
const {tmpDir, webpackConfig} = t.context; | |||
const config = hconf(tmpDir, ['FOLDERS', 'VULCANIZE_NO_JS', 'MANIFEST']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LasaleFamine maybe 'MANIFEST' configuration is useless here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now should be correct.
No description provided.