Closed akmoulai closed 8 years ago
@akmoulai sorry, not in v2. I'm working in a complete rewrite for v3 which will support this and other features. Currently, the compiler API is convoluted and inconsistent, I hope v3 will be more simple and versatile.
@aMarCruz Thanks for your feedback, closing the issue... Please let me know if you would consider a PR!
@aMarCruz btw this feature should be already implemented https://github.com/riot/compiler/commit/124e620ea513ad84700af5a9469c378ee922e1cf and the option name is called parserOptions
UPDATE: nevermind parsetOptions
does something else sorry for the confusion
@GianlucaGuarini I'd really like to set my parsers through parserOptions
, but after going through the code it didn't look like a possibility :(
It'd be really easy to add this feature by merging whatever parsers
that are supplied (as an object) into riot.parsers
.
After searching a quite a bit, the only way I found to pass custom CSS parsers was to use
riot.parsers.css.myCustomCSSParser
which is fine if you have access to theriot
's instance.However, I'm in a situation where we use esnunes/riotjs-loader and I have no way to modify riot's instance. The only thing I can pass through with webpack is the
options
for thecompiler.compile
function (done through thequery
object in webpack).Do you think you could make supplying new custom parsers definitions through the opts?
Something like:
There may be other useful use cases (I'm new to Riot).
@GianlucaGuarini @aMarCruz Thanks for considering !
Edit: the need for this is to add
postcss
autoprefixer
to SCSS styles defined in the tags. All of that with webpack!