Download the PHP package dnunez24/craft-laravel-mix without Composer

On this page you can find all versions of the php package dnunez24/craft-laravel-mix. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package craft-laravel-mix

CraftCMS Laravel Mix

A CraftCMS plugin that enables the use of Laravel Mix for managing asset builds.

Requirements

Installation

Manual

Download and install this plugin to your CRAFT_PLUGINS_PATH. Rename the directory to mix to correspond with the plugin handle. For example, if your CRAFT_PLUGINS_PATH is craft/plugins, you could run the following from the root of your project:

Then install the plugin from the CraftCMS administrative panel.

Composer

If you use Composer for managing dependencies, you can install this plugin by requiring it from your composer.json file. This plugin's composer package type is craft-plugin so Composer can install it directly into your Craft plugins directory. However, before installing the dependency, you must add an extra configuration option to rename the destination directory of the plugin. For example, if your CRAFT_PLUGINS_PATH is craft/plugins, then you would add the following configuration to your composer.json:

For more information about configuring the destination of the package during installation, see the Composer Installers.

Then simply require the package to ad it to your composer.json file and install it:

Create a package.json file with the following contents to install Laravel Mix dependencies and configure asset build tasks.

Install the Node.js dependencies using npm or yarn.

Configuration

To demonstrate usage of the plugin, let's imagine a project with the following directory structure.

Create a webpack.mix.js file at the root of your project to configure Laravel Mix for building your assets. See the Laravel Mix documentation for configuration details and more options. Be sure to configure the publicPath option to point at the directory from which you will serve static assets (images, fonts, javascript and CSS). Here's an example configuration as a starting point that would work with the previously described project structure:

This plugin also provides a CraftCMS configuration value to set the public directory that it uses to locate and read from the Mix manifest file. You may want to override the setting if your path differs from the default (CRAFT_BASE_PATH/public). You can do this by creating a file at CRAFT_CONFIG_PATH/mix.php with the following contents:

Usage

The primary purpose of this plugin is to provide template helpers that translate between a known path to your build assets and the real path to the assets after they have been built (which varies depending on the build mode). There are three main ways you can use Mix from Twig templates in CraftCMS:

There are a handful of different modes in which you can run Mix and the plugin will work differently in each mode, as described in the following sections.

Dev Mode

Dev mode will build your assets to target a development environment. Depending on how you've configured Mix, this may bypass certain build instructions intended only for the production environment. In the example webpack.mix.js file, we are only versioning assets in production mode for cache busting or similar use cases. You can build the assets for developer mode by using the npm script we added in our package.json file:

This will generate the following files in our example project structure:

You can then use the Twig helpers from this plugin in your templates to load the assets from the mix-manifest.json file:

Yields

Watch Mode

Functions just like Dev Mode except Mix will continue running as a foreground process through NodeJS and building assets as changes to the source files are detected.

Hot Module Replacement Mode

Builds your assets and runs the Webpack dev server to allow Hot Module Replacement. It works very similarly to what is described in the Laravel Mix documentation. To run in HMR mode, run the following command:

You can then use the Twig helpers from this plugin in your templates to load the assets from the Webpack dev server (running at //localhost:8080):

Yields

Production Mode

or bundle your assets for production

This will generate the following files in our example project structure:

You can then use the Twig helpers from this plugin in your templates to load the assets from the mix-manifest.json file:

Yields

Acknowledgements

TODO

License

Craft Laravel Mix is open source software licensed under the MIT license.


All versions of craft-laravel-mix with dependencies

PHP Build Version
Package Version
Requires php Version >= 7.0.0
composer/installers Version ~1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package dnunez24/craft-laravel-mix contains the following files

Loading the files please wait ....