PHPackages                             weprovide/aviate-magento2 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. weprovide/aviate-magento2

AbandonedArchivedLibrary

weprovide/aviate-magento2
=========================

Aviate implementation for Magento 2

1.0.0(8y ago)046.0k1MITPHP

Since Sep 6Pushed 8y ago2 watchersCompare

[ Source](https://github.com/weprovide/aviate-magento2)[ Packagist](https://packagist.org/packages/weprovide/aviate-magento2)[ RSS](/packages/weprovide-aviate-magento2/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (7)Used By (0)

Aviate Magento 2
================

[](#aviate-magento-2)

Aviate implementation for Magento 2.

Installation
------------

[](#installation)

```
composer require weprovide/aviate-magento2

```

Configuration
-------------

[](#configuration)

```
const path = require('path')

// NAMESPACE/THEME Needs to match your exact theme namespace and name. Since the module will automatically load NAMESPACE/THEME.css
module.exports = {
    // For production we expect the assets to be in web/dist
    distLocations: [
        path.join(__dirname, 'app/design/frontend/NAMESPACE/THEME/web/dist')
    ],
    decorateConfig(config) {
        config.entry = Object.assign({}, config.entry, {
            'NAMESPACE/THEME': [
                path.join(__dirname, 'app/design/frontend/NAMESPACE/THEME/styles/styles.scss')
            ]
        })

        // Allows you to use relative paths to theme in your CSS and Javascript. For SASS you can use @import "~theme/path/to/file"
        config.resolve = {
            alias: {
                theme: path.join(__dirname, 'app/design/frontend/NAMESPACE/THEME')
            }
        }

        return config
    }
}
```

Adding custom files
-------------------

[](#adding-custom-files)

In some cases you'll want to add custom files. For example a React application. You can achieve this using [Magento 2 Interceptors](http://devdocs.magento.com/guides/v2.0/extension-dev-guide/plugins.html).

`aviate.config.js` (in project root):

```
const path = require('path')

// NAMESPACE/THEME Needs to match your exact theme namespace and name. Since the module will automatically load NAMESPACE/THEME.css
module.exports = {
    // For production we expect the assets to be in web/dist
    distLocations: [
        path.join(__dirname, 'app/design/frontend/NAMESPACE/THEME/web/dist')
    ],
    decorateConfig(config) {
        config.entry = Object.assign({}, config.entry, {
            'NAMESPACE/THEME': [
                path.join(__dirname, 'app/design/frontend/NAMESPACE/THEME/styles/styles.scss')
            ],
            // This part is the custom file
            'NAMESPACE/THEME/react': [
                'react-hot-loader/patch',
                path.join(__dirname, 'app/design/frontend/NAMESPACE/THEME/react/app.js'),
            ]
        })

        // Allows you to use relative paths to theme in your CSS and Javascript. For SASS you can use @import "~theme/path/to/file"
        config.resolve = {
            alias: {
                theme: path.join(__dirname, 'app/design/frontend/NAMESPACE/THEME')
            }
        }

        return config
    }
}
```

`etc/di.xml`:

```

```

`Plugin/AddReact.php`:

```
