riotjs-loader icon indicating copy to clipboard operation
riotjs-loader copied to clipboard

Are custom parsers possible?

Open JosephScript opened this issue 7 years ago • 1 comments

Is there any way to add a custom css parser using this loader? For example:

preLoaders: [
      { 
        test: /\.tag$/,
        exclude: /node_modules/,
        loader: 'riotjs-loader',
        query: {
          type: 'es6',
          style: 'myparser',
          parsers: {
            css: {
              myparser: (tagName, css) => {
                return css.replace(/@tag/, tag)
              }
            }
          }
        }
     }
    ]

I've tried a handful of things, and always get the error Module build failed: Error: Riot parser "css. myparser" is not registered. when including the style type <style type='myparser'>.

Thanks!

JosephScript avatar Jan 04 '17 18:01 JosephScript