Giter Club home page Giter Club logo

mixeer's Introduction

MixEEr

This addon brings Laravel Mix's mix() method to ExpressionEngine's template system.

Preamble

  • This addon assumes you've already got your webpack.mix.js file and build tools set up, it does not include the base Laravel Mix build tools, read this if you need help getting started with Laravel Mix.
  • Laravel Mix works best when the public path is either a sibling or below its own directory. Therefore, because it's best practice to move ExpressionEngine's system/ directory above the public/ directory, you should setup Laravel Mix as a sibling of the system/ directory.

Here's an example directory structure:

    ├── system/
    │   ├── ee/
    │   └── user/
    │   ├── index.html
    │   ├── index.php
    ├── node_modules/
    ├── public/
    │   ├── assets/
    │   │   ├── css/
    │   │   └── js/
    │   ├── images/
    │   └── themes/
    │   ├── admin.php
    │   ├── favicon.ico
    │   ├── index.php
    │   ├── mix-manifest.json
    ├── resources/
    │   ├── fonts/
    │   ├── js/
    │   └── sass/
    ├── webpack.mix.js
    ├── package.json
  • You may be unable to compile assets until you specify the publicPath in your Mix options:
mix.sass('resources/sass/app.scss', 'public/assets/css')
    .js('resources/js/app.js', 'public/assets/js')
    .options({
        publicPath: 'public',
    });

Installation

  • Download the MixEEr addon.
  • Copy the mix/ directory to the system/user/addons/ directory.
  • In ExpressionEngine's control panel go to Developer > Addons and install the plugin.

Usage

Once the plugin is installed you can use the {exp:mix} tag in your templates:

<link rel="stylesheet" href="{exp:mix file='assets/css/app.css'}">
<script src="{exp:mix file='assets/js/app.js'}"></script>

If you are overriding the directory of Laravel Mix's generated mix-manifest.json file you may also pass the manifest_dir parameter:

<link rel="stylesheet" href="{exp:mix manifest_dir='assets/manifest' file='assets/css/app.css'}">

mixeer's People

Contributors

benjivm avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.