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.
eightshiftBlocksUtilityHelpersPath
We have also created a bunch of JavaScript helpers located in the helpers folder.
This alias provides only path to the helpers folder.
import { media } from 'eightshiftBlocksUtilityHelpersPath/media';
eightshiftFrontendLibs
Alias providing eightshift Frontend Libs.
@import 'eightshiftFrontendLibs';
eightshiftEditorStyleOverride
It provides the Block Editor overrides on some styles to give better UX for our block.
@import 'eightshiftEditorStyleOverride';
eightshiftComponentColorPalette
Alias providing custom React component. For more details check here.
eightshiftComponentHeadingLevel
Alias providing custom React component. For more details check here.