Scenario: GobbleJS workflow with merge nodes, and a rollup transform with some rollup plugins, like:
var code = gobble([txt, js])
.transform('rollup', {
entry: 'main.js',
dest: 'dist/main.js',
format: 'cjs',
sourceMap: true,
plugins: [
require('rollup-plugin-string')({ include: '**/*.txt' }),
require('rollup-plugin-buble')({ exclude: '**/*.txt'}),
require('rollup-plugin-commonjs')(),
require('rollup-plugin-node-resolve')()
]
});
Due to Gobble's merge nodes, the files are in a path containing the hidden subdirectory name .gobble, like:
/home/ivan/devel/project/.gobble/03-merge/1/src/submodule/messages.txt
This was throwing errors in the buble transform, as apparently the *.txt files were being processed by rollup-plugin-buble, where I wanted them to be processed just by rollup-plugin-string.
Fortunately, I've been able to track down the problem to createFilter in the rollup-pluginutils module.
See, createFilter uses minimatch, and looking at its documentation I found this bit:
All options are false by default.
[…]
dot
Allow patterns to match filenames starting with a period, even if the pattern does not explicitly have a period in that spot.
Note that by default, a/**/b will not match a/.d/b, unless dot is set.
This means that all filters for all rollup plugins are broken when rollup is used within gobble (not sure about whether other build tools use paths with dot-files for temp/hidden files).
I think I can work around the issue by specifying minimatch patterns with an explicit .gobble/**/ for every rollup plugin, but this is totally counter-intuitive.
So:
- What would be a sane default for the
dot setting of minimatch?
- Should
createFilter accept an extra set of minimach options?
- How can we make gobble-rollup force
dot=true in the rollup plugin filters?
Scenario: GobbleJS workflow with merge nodes, and a rollup transform with some rollup plugins, like:
Due to Gobble's merge nodes, the files are in a path containing the hidden subdirectory name
.gobble, like:This was throwing errors in the
bubletransform, as apparently the*.txtfiles were being processed byrollup-plugin-buble, where I wanted them to be processed just byrollup-plugin-string.Fortunately, I've been able to track down the problem to
createFilterin therollup-pluginutilsmodule.See,
createFilterusesminimatch, and looking at its documentation I found this bit:This means that all filters for all rollup plugins are broken when rollup is used within gobble (not sure about whether other build tools use paths with dot-files for temp/hidden files).
I think I can work around the issue by specifying minimatch patterns with an explicit
.gobble/**/for every rollup plugin, but this is totally counter-intuitive.So:
dotsetting ofminimatch?createFilteraccept an extra set ofminimachoptions?dot=truein the rollup plugin filters?