2
0
mirror of https://github.com/tenrok/BBob.git synced 2026-06-14 18:42:24 +03:00

refactor: reduce dist files sizes (#76)

* fix(parser): plugin-helper import, remove dist file code duplication

* feat(plugin-helper): reduce bundle size, set new limits to 650 bytes

* refactor(preset): html5, react presets to reduce the size of dist files
This commit is contained in:
Nikolay Kostyurin
2020-12-09 00:01:34 +02:00
committed by GitHub
parent 4e79abb833
commit fda6ddd6ee
6 changed files with 64 additions and 96 deletions
+13 -15
View File
@@ -1,33 +1,31 @@
import presetHTML5 from '@bbob/preset-html5';
const tagAttr = (style) => ({
attrs: {
style,
},
});
export default presetHTML5.extend((tags) => ({
...tags,
b: (...args) => ({
...tags.b(...args),
attrs: {
style: { fontWeight: 'bold' },
},
...tagAttr({ fontWeight: 'bold' }),
}),
i: (...args) => ({
...tags.b(...args),
attrs: {
style: { fontStyle: 'italic' },
},
...tags.i(...args),
...tagAttr({ fontStyle: 'italic' }),
}),
u: (...args) => ({
...tags.b(...args),
attrs: {
style: { textDecoration: 'underline' },
},
...tags.u(...args),
...tagAttr({ textDecoration: 'underline' }),
}),
s: (...args) => ({
...tags.b(...args),
attrs: {
style: { textDecoration: 'line-through' },
},
...tags.s(...args),
...tagAttr({ textDecoration: 'line-through' }),
}),
}));