npm.io
0.0.5 • Published 4 years ago

cem-plugin-module-file-extensions

Licence
MIT
Version
0.0.5
Deps
0
Size
3 kB
Vulns
0
Weekly
0
Stars
5

cem-plugin-readonly

Adds (non-standard) "readonly" flag to class fields

Options

from and to are the 1st and 2nd parameter to String#replace.

Option Type Default Description
from string | RegExp /\.(t|j)sx?$/ path replacement test
to string | function '.js' replacer string or function

Example

custom-elements-manifest.config.js

import { moduleFileExtensionsPlugin } from 'cem-plugin-module-file-extensions';

export default {
  globs: '*.ts',
  plugins: [
    moduleFileExtensionsPlugin(),
  ]
}
Output
{
  "schemaVersion": "1.0.0",
  "readme": "",
  "modules": [
    {
      "kind": "javascript-module",
      "path": "my-element.js",
      "declarations": [
        {
          "kind": "class",
          "description": "",
          "name": "MyElement",
          "customElement": true
        }
      ],
      "exports": [
        {
          "kind": "js",
          "name": "MyElement",
          "declaration": {
            "name": "MyElement",
            "module": "my-element.js"
          }
        }
      ]
    }
  ]
}

Keywords