cem-plugin-module-file-extensions
v0.0.5
Published
Rewrite module path file extentions
Downloads
10,062
Maintainers
Readme
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"
}
}
]
}
]
}