riot-v6-jest-transformer

0.0.1 • Public • Published

Riot-v6-jest-transformer

Usage

Install via NPM with babel-jest, which this module depends.

npm i -D babel-jest riot-v6-jest-transformer

Edit jest.config.js or something like this.

module.exports = {
  moduleFileExtensions: [
    "js",
    "riot",
  ],
  transform: {
    "^.+\\.js$": "babel-jest",
    "^.+\\.riot$": "./lib/index.js"
  }
}

Note

This module requires babel environment.

You need to prepare for your own.

Install modules.

npm i -D @babel/core @babel/preset-env

Edit .babelrc.

{
  "presets": [
    [
      "@babel/preset-env",
      {
        "targets": {
          "node": "current",
        },
      },
    ],
  ]
}

Remember to set "@babel/preset-typescript" with allowExtension if you use TypeScript in your tags.

{
  "presets": [
    [
      "@babel/preset-env",
      {
        "targets": {
          "node": "current",
        },
      },
    ],
    [
      "@babel/preset-typescript",
      {
        "allExtensions": true,
      }
    ]
  ]
}

Readme

Keywords

none

Package Sidebar

Install

npm i riot-v6-jest-transformer

Weekly Downloads

0

Version

0.0.1

License

MIT

Unpacked Size

6.84 kB

Total Files

17

Last publish

Collaborators

  • karak