Aliases
We have created a lot of helpful aliases that you can use in your project.
EightshiftBlocksWhatwgFetch
Alias providing Whatwg-fetch.
import 'EightshiftBlocksWhatwgFetch';
EightshiftBlocksSwiper
Alias providing Swiper.
import 'EightshiftBlocksSwiper';
EightshiftBlocksSwiperIE
Alias providing Swiper but for IE11 version.
import 'EightshiftBlocksSwiperIE';
EightshiftBlocksBabelPolyfill
Alias providing Babel Polyfill.
import 'EightshiftBlocksBabelPolyfill';
EightshiftBlocksAutoprefixer
Alias providing Autoprefixer.
import 'EightshiftBlocksAutoprefixer';
EightshiftBlocksNormalize
Alias providing Normalize. Check documentation for more details.
@import 'EightshiftBlocksNormalize';
@include normalize(); // stylelint-disable-line at-rule-empty-line-before
EightshiftBlocksMediaBlender
Alias providing Media Blender. Check documentation for more details.
@import 'EightshiftBlocksMediaBlender';
EightshiftBlocksSwiperStyle
Alias providing Swiper.
@import 'EightshiftBlocksSwiperStyle';
EightshiftBlocksDynamicImport
To get (require) all the files using the require.context
method, we created a helper located here.
It will find all files recursively in the folder using a regex. The following example will require all assets/index.js
files inside the custom
folder, so there is no need to add the files to the build manually.
import { dynamicImport } from 'EightshiftBlocksDynamicImport';
dynamicImport(require.context('./../../custom', true, /assets\/index.js$/));
EightshiftBlocksRegisterBlocks
Alias providing blocks registration. For more details check here.
EightshiftBlocksUcfirst
Converts the first letter of a string to uppercase.
import { ucfirst } from 'EightshiftBlocksUcfirst';
ucfirst('custom string');
EightshiftBlocksGetActions
Alias providing blocks actions helper. For more details check here.