Download the PHP package jacerider/neo_build without Composer
On this page you can find all versions of the php package jacerider/neo_build. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jacerider/neo_build
More information about jacerider/neo_build
Files in jacerider/neo_build
Package neo_build
Short Description Build tools including Vite and Tailwind integration.
License proprietary
Homepage https://github.com/jacerider/neo_build
Informations about the package neo_build
CONTENTS OF THIS FILE
- Introduction
- Requirements
- Installation
- Usage
- Build for DEV
- Build for PROD
- Build Groups
- Configuration
INTRODUCTION
Vite integration for Drupal asset libraries.
REQUIREMENTS
This module requires no modules outside of Drupal core.
It's designed to work with Vite 3 or newer and Tailwind and Typescript.
INSTALLATION
Install as you would normally install a contributed Drupal module. Visit https://www.drupal.org/node/1897420 for further information.
Add to .gitignore:
If using DDEV, create a file called neo.conf
in .ddev/nginx/
with the
following content:
USAGE
- Enable the module.
- Run
drush neo-install
from site root. -
Run
npm install
from site root. -
In the
<theme|module>.libraries.yml
, for the library you would like to use assets build by Neo, add propertyneo: true
and when defining assets provide their paths to entry points used in neo instead of paths to build assets. For example: - The module will dynamically rewrite assets paths to dist and include their dependencies defined in manifest.json.
BUILD FOR DEV
To use hot module reload during development, run:
The server will run in non-HTTPS mode to avoid XSS issues. If the server is accessible on the localhost under default port (5173) the module will automatically start using it instead of dist assets from manifest.json as soon as you clear the cache (library definitions are cached by default).
BUILD FOR PROD
To compile js and css for all scopes (only 'contrib' group), run:
BUILD SCOPES
In <theme/module>.libraries.yml
there is also an option to set the build
scope. The scope impacts Tailwind so that aggregated classes are only built
for the build of this scope when calling @tailwind base;
within a CSS or
SCSS file. For example:
A theme should define their supported scopes in their info.yml.
or
If a scope is not defined, theme will act on all scopes.
BUILD GROUPS
In <theme/module>.libraries.yml
there is also an option to set the build
group. The group controls what libraries are proccessed during dev. If no
group is specified for a library, custom
is used by default. By default, there
are only two groups; 'custom' and 'contrib'. For example:
The contrib
group should be used for contrib modules or themes.
SCSS GLOBAL INCLUDES
Sass stylesheets can be exposed so they can be loaded in other stylesheets
using the @use
rule.
To use includes within a Sass stylesheet:
CONFIGURATION
In library definition instead of only enabling neo support by setting
neo: true
theres also an option to provide some custom configurations.
These settings can also be overwritten in site settings.php:
In <theme/module>.libraries.yml
there is also an option to disable rewriting
of specific asset, to do that you need to set neo: false
for specific asset.
For example:
COMPONENTS
You can register new Tailwind components by defining them in your theme/module info file. For example:
THEME
You can extend the Tailwind base configuration by defining the settings in your theme/module info file. For example: