-
Notifications
You must be signed in to change notification settings - Fork 0
/
jtsx.config.example.js
23 lines (19 loc) · 1.02 KB
/
jtsx.config.example.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
export default {
// When true disables warnings when uses React camelCase attributes, like htmlFor instead of for xLinkHref instead of xlink:href
disableAttrWarnings: false,
// When true - rewrite react camelCase attributes into default HTML name style
rewriteReactAttrs: false,
// Esbuild transform config https://esbuild.github.io/api/#transform
esbuildTransformConfig: undefined,
// custom factory path, #@ is native node.js alias from package.json
importFactory: `import { _jsx, _jsxFragment, _jsxUtils } from 'jtsx-loader/factory/jsxFactory.js';`,
// Custom attribute parser. Attribute with colon determined as custom and called method by first part before colon
// Example method below will be called for attribute "ac:anything" in jsx and returns data-ac-anything="value"
attributeParser: {
ac: (attribute, value) => {
const attr = attribute.replace(/:/gi, '-');
console.log('attr', attr);
return `data-${attr}="${value}"`;
}
}
}