We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
e.g. I'd like
<head> {{testFiles}} </head>
replaced with:
<head> var testFiles=['tests/foo.js, 'tests/bar.js']; </head>
I'm able to get that with this configuration:
const testFiles = `['some/path', 'another/path']`; const testHTML = new Replace('tests', { files: ['**/*.html'], patterns: [ { match: /{{testFiles}}/, replacement: `<script>var testFiles=${testFiles};</script>` } ] });
Which is OK but I have to 'pre-stringify' the array I'd like to insert.
I'm curious on your thoughts w/ supporting inserting Objects or Arrays as-is.
The text was updated successfully, but these errors were encountered:
Hi, sorry for the long delay, you could try it in the following way:
const testFiles = ['some/path', 'another/path']; const testHTML = new Replace('tests', { files: ['**/*.html'], patterns: [ { match: /{{testFiles}}/, replacement: `<script>var testFiles=${JSON.stringify(testFiles)};</script>` } ] });
Sorry, something went wrong.
No branches or pull requests
e.g. I'd like
replaced with:
I'm able to get that with this configuration:
Which is OK but I have to 'pre-stringify' the array I'd like to insert.
I'm curious on your thoughts w/ supporting inserting Objects or Arrays as-is.
The text was updated successfully, but these errors were encountered: