0.2.3 • Published 5 years ago

vue-native-custom-transformer-plugin v0.2.3

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

vue-native-custom-transformer-plugin

What is this?

  • Plugin to add supports for custom languages like Pug, Stylus in vue-native component.

How to use

Example app

Warning

  • This is an experimental product.
  • Do not use this package in production.
  • This plugin transpiles each files. (importing another file may causes something odd.)

Builtin plugins

template

  • Pug (alpha)

script

  • TypeScript (alpha)

styles

  • Stylus (alpha)

Custom plugins

Example

  • I've not tested if this coffee example works.
const CoffeeScript = require('coffeescript')

module.exports = {
  // configure transformer plugins
  plugins: {
    template: ['pug'],
    script: [
      'ts',
      {
        lang: 'coffee', // This must be set in "lang" attribute.
        transform(content) {
          return CoffeeScript.compile(content);
        },
      },
    ],
  },
};

License

MIT

Credits