Answer the question
In order to leave comments, you need to log in
Does grunt-concat have analogues that support import (in a file)?
Please tell me a grunt plugin similar to grunt-concat, but it understands import directives in the collected files:
Something @import 'foo/bar.md'
like this - should insert the contents of foo/bar.md in place of this line
It is clear that bar.md can also contain import directives.
My google-fu didn't help me. All found plug-ins do not do the right thing.
Thank you!
Answer the question
In order to leave comments, you need to log in
I wrote my task , it's not difficult.
We read the file , go through the regular expression, find the file names, replace, write the file where it should be.
The replacement will look something like this:
fileContent = fileContent.replace(/@import '(\S+)'/mg, function (match, filepath) {
return grunt.file.read(filepath)
})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question