This is cssnano-preset-default, but without SVGO. It's a fraction of the size on disk if you're looking to avoid the 10mb footprint.
This file contains hidden or 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
| package-lock.json | |
| node_modules |
This file contains hidden or 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
| import { h, options } from 'preact'; | |
| const X = 'props' in h('a'); | |
| export const getProps = X ? vnode => vnode.props : vnode => vnode.attributes; | |
| export const setProps = X | |
| ? (vnode, props) => { vnode.props = props; } | |
| : (vnode, props) => { vnode.attributes = props; }; |
This file contains hidden or 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
| const Component = require('preact/compat').Component; | |
| const AUTOBIND_BLACKLIST = { | |
| constructor: 1, | |
| render: 1, | |
| shouldComponentUpdate: 1, | |
| componentWillReceiveProps: 1, | |
| componentWillUpdate: 1, | |
| componentDidUpdate: 1, | |
| componentWillMount: 1, |
Polyfill dynamic import() in all ES Modules-supporting browsers.
Drop this polyfill into your page: https://github.com/GoogleChromeLabs/dynamic-import-polyfill
... then add the Babel transform:
import dynamicImportPolyfill from 'dynamic-import-polyfill';
This file contains hidden or 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
| if (!('trimStart' in String.prototype)) String.prototype.trimStart = String.prototype.trimLeft; | |
| if (!('trimEnd' in String.prototype)) String.prototype.trimEnd = String.prototype.trimRight; | |
| if (!('forEach' in NodeList.prototype)) NodeList.prototype.forEach = [].forEach; | |
| if (!('description' in Symbol.prototype)) { | |
| Object.defineProperty(Symbol.prototype, 'description', { | |
| get() { return /\((.+)\)/.exec(this)[1] } | |
| }); | |
| } |
This file contains hidden or 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
| import regexparam from 'https://unpkg.com/regexparam@1/dist/regexparam.mjs'; | |
| /** | |
| * <url-route href="/profile/:user"> | |
| * <div>some content here</div> | |
| * </url-route> | |
| */ | |
| customElements.define('url-route', class UrlRoute extends HTMLElement { | |
| connectedCallback() { | |
| this.route = regexparam(this.getAttribute('href')); |