-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
6 changed files
with
64 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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' }), | ||
}), | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters