v1.0.0-alpha.27
Pre-releaseBREAKING CHANGES
- #450 Webpack v4. Add template and layout specific JS entrypoints.
- #488 Add concat-style-loader to handle Liquid Style files. (@t-kelly)
Huge performance improvements for Themes on it's way with the introduction of Webpack 4 and its automatic bundle splitting. This allows Layouts and Templates to have their own independent JS and CSS bundles that are only loaded on the appropriate page(s). Say goodbye to JS and CSS bloat!
You must now include the following in the <head>
of any layout file you wish to have JS and CSS. For example, this is what you would put inside the <head>
of your layouts/theme.liquid
file:
{% include 'script-tags', layout: 'theme' %}
{% include 'style-tags' %}
These snippets are generated automatically by Slate Tools at build. Their contents include <script>
and <link>
tags for each JS and CSS bundles.
You now must also have a src/assets/scripts/layouts
folder and a src/assets/scripts/templates
. Any file contained in these folders which have a name the same as their Liquid counterpart is considered an entrypoint. For example, if I create a src/assets/scripts/templates/index.js
file, it's contents will only be downloaded and run when a user visits the Index page.
🚀 Enhancement
concat-style-loader
,slate-tools
slate-sync
,slate-tools
create-slate-theme
,html-webpack-liquid-asset-tags-plugin
,slate-analytics
,slate-sync
,slate-tag-webpack-plugin
,slate-tools
🐛 Bug Fix
📝 Documentation
🏠 Internal
slate-sync
,slate-tools
slate-babel
,slate-common-excludes
,slate-tools