2017 © Pedro Peláez
 

wordpress-muplugin aviate-wordpress

Aviate implementation for WordPress

image

weprovide/aviate-wordpress

Aviate implementation for WordPress

  • Tuesday, October 31, 2017
  • by timneutkens
  • Repository
  • 2 Watchers
  • 0 Stars
  • 109 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 28 % Grown

The README.md

Aviate WordPress

Aviate implementation for WordPress., (*1)

Installation

composer require weprovide/aviate-wordpress

Usage

const path = require('path')
const env = process.env.NODE_ENV || 'development'
const isDev = env === 'development'

module.exports = {
    distLocations: [
        path.join(__dirname, 'web/app/themes/yourtheme/dist')
    ],
    decorateConfig(config) {
        config.output.publicPath = isDev ? host : './'

        config.entry = Object.assign({}, config.entry, {
            'styles': [
                path.join(__dirname, 'web/app/themes/yourtheme/assets/styles/main.scss')
            ],
            'javascript': [
                path.join(__dirname, 'web/app/themes/yourtheme/assets/javascript/main.js')
            ]
        })

        return config
    }
}

Adding custom files

aviate.config.js:, (*2)

const path = require('path')
const env = process.env.NODE_ENV || 'development'
const isDev = env === 'development'

module.exports = {
    distLocations: [
        path.join(__dirname, 'web/app/themes/yourtheme/dist')
    ],
    decorateConfig(config) {
        config.output.publicPath = isDev ? host : './'

        config.entry = Object.assign({}, config.entry, {
            'styles': [
                path.join(__dirname, 'web/app/themes/yourtheme/assets/styles/main.scss')
            ],
            'javascript': [
                path.join(__dirname, 'web/app/themes/yourtheme/assets/javascript/main.js')
            ],
            'your-file': [
                path.join(__dirname, 'web/app/themes/yourtheme/assets/javascript/example.js')
            ]
        })

        return config
    }
}

functions.php:, (*3)

<?php
namespace YourVendor\YourTheme;

function aviateFiles($files, $aviate) {
    if($aviate->isDevelopment()) {
        $files['js'][] = $aviate->getDevServerUrl('your-file.js');
        return $files;
    }

    $files['js'][] = $aviate->getProductionUrl('your-file.js');

    return $files;
}

add_filter('aviate_files', __NAMESPACE__.'\\aviateFiles', 10, 2);

The Versions

31/10 2017

dev-master

9999999-dev

Aviate implementation for WordPress

  Sources   Download

MIT

The Requires

 

by Tim Neutkens

31/10 2017

0.1.1

0.1.1.0

Aviate implementation for WordPress

  Sources   Download

MIT

The Requires

 

by Tim Neutkens

10/09 2017

0.1.0

0.1.0.0

Aviate implementation for WordPress

  Sources   Download

MIT

The Requires

 

by Tim Neutkens

10/09 2017

0.0.2

0.0.2.0

Aviate implementation for WordPress

  Sources   Download

MIT

The Requires

 

by Tim Neutkens

10/09 2017

0.0.1

0.0.1.0

Aviate implementation for WordPress

  Sources   Download

MIT

The Requires

 

by Tim Neutkens