outatime / broccoli-replace Goto Github PK
View Code? Open in Web Editor NEWReplace text patterns with applause.
License: MIT License
Replace text patterns with applause.
License: MIT License
Current applause
package contains "Prototype Pollution" vulnerability.
As I've noticed the package doesn't seem to be maintained, there are already issues reported without answer. For now I suggest to use alternative package as suggested here wdyt?
This plugin is just what I need - except part of what I need to replace in my file is the relative path to the file being processed (for a <script>
tag insertion based on the current directory).
Could you provide some config to make this possible?
Note, the processString method
Line 48 in 08be5ed
I have the following code:
new BroccoliReplace(new Funnel('node_modules/node-viewerjs/release', { destDir: '/ViewerJS' }), {
files: ['**/*.js'],
patterns: [{ match: /ODFViewerPlugin_css/, replacement: '""' }],
}),
The idea is that I want the files from node_modules/node-viewerjs/release
copied in the release and then in the JS files this string to be replaced. There are also images in this directory which shouldn't be touched. This worked fine until version 2.0.0 (of course new BroccoliReplace
was just BroccoliReplace
). 2.0.0 and 2.0.1 modify the image files somehow.
Am I doing something wrong or is this a bug?
Once outaTiME/applause#11 is resolved this repo's dependency on the applause
dependency should be upgraded to address the
[email protected]: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
deprecation.
I try to use broccoli-replace as some kind of a template engine (to replace @@include
with partial HTML content).
But I cannot use it like that because replacement happens only once. On the initial build. How can I fix that?
I'm stucked here:
How to insert this in an in-repo-addon?
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.