PHPackages                             ntpages/laravel-encore - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. ntpages/laravel-encore

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ntpages/laravel-encore
======================

Symfony's Webpack Encore for Laravel

02.2k↓100%PHP

Since Jul 13Pushed 4y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Encore
==============

[](#laravel-encore)

Package made for those who understand the power of [symfony/webpack-encore](https://github.com/symfony/webpack-encore)

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

[](#installation)

### Frontend

[](#frontend)

You can read more about webpack encore on [official symfony's docs page](https://symfony.com/doc/current/frontend.html#webpack-encore).

For the Laravel project you'll only need next setup:

1. Install the node package
    `yarn add @symfony/webpack-encore --dev`
2. Create basic configuration file `webpack.config.js`

```
const Encore = require('@symfony/webpack-encore');

/* [configuration and entrypoints, see docs] */

module.exports = Encore.getWebpackConfig();
```

3. Add shortcuts to the `package.json` scripts section

```
{
    "dev-server": "encore dev-server",
    "dev": "encore dev",
    "build": "encore production",
    "deploy": "encore production"
}
```

### Backend

[](#backend)

1. Install the PHP library on your Laravel project
    `composer require ntpages/laravel-encore`
2. Copy the config files
    `php artisan vendor:publish`
3. Add the provider in `config/app.php` providers section

```
