PHPackages                             innocenzi/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. innocenzi/laravel-encore

Abandoned → [innocenzi/laravel-vite](/?search=innocenzi%2Flaravel-vite)Library[Utility &amp; Helpers](/categories/utility)

innocenzi/laravel-encore
========================

Integrate Webpack Encore in Laravel.

v0.5.0(4y ago)34.0k4[1 PRs](https://github.com/innocenzi/laravel-encore/pulls)MITPHPPHP ^7.4|^8.0CI failing

Since Jun 12Pushed 3y ago1 watchersCompare

[ Source](https://github.com/innocenzi/laravel-encore)[ Packagist](https://packagist.org/packages/innocenzi/laravel-encore)[ Docs](https://github.com/innocenzi/laravel-encore)[ RSS](/packages/innocenzi-laravel-encore/feed)WikiDiscussions master Synced yesterday

READMEChangelog (6)Dependencies (4)Versions (7)Used By (0)

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

[](#laravel-encore)

 [ ![Latest version on Packagist](https://camo.githubusercontent.com/528e5ead16a0712e669bb8ea5379c681cf2fe8399681d1e10049514488e1e935/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696e6e6f63656e7a692f6c61726176656c2d656e636f72652e737667) ](https://packagist.org/packages/innocenzi/laravel-encore) [ ![Total Downloads](https://camo.githubusercontent.com/6b0b67befb8c4d0a6d7b7ab5cf8b1fd17f0aee5a8ea9c567b6a43477e715faae/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696e6e6f63656e7a692f6c61726176656c2d656e636f72652e737667) ](https://packagist.org/packages/innocenzi/laravel-encore) [ ![Build](https://github.com/innocenzi/laravel-encore/workflows/CI/badge.svg) ](https://github.com/innocenzi/laravel-encore/actions)

This package helps integrating [Webpack Encore](https://symfony.com/doc/current/frontend/encore) with Laravel.

> **Note**: while this package should work, I'm not planning on fixing potential issues or updating it, since I'm no longer using it. If you want a better development environment, consider [Laravel Vite](https://github.com/innocenzi/laravel-vite) using the new Vite integration from the Laravel team.

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

[](#installation)

You can install the package via composer:

```
composer require innocenzi/laravel-encore
```

Installing Encore
-----------------

[](#installing-encore)

Remove `laravel-mix` and add `@symfony/webpack-encore`.

```
yarn remove laravel-mix
yarn add @symfony/webpack-encore --dev
```

Remove your `webpack.mix.js` and create a `webpack.config.js`. Here is an example:

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

if (!Encore.isRuntimeEnvironmentConfigured()) {
  Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');
}

Encore
  .setOutputPath('public/build/')
  .setPublicPath('/build')
  .addEntry('app', './resources/js/app.js')
  .splitEntryChunks()
  .enableSingleRuntimeChunk()
  .enablePostCssLoader()
  .cleanupOutputBeforeBuild()
  .enableSourceMaps(!Encore.isProduction())
  .enableVersioning(Encore.isProduction());

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

Make sure `resources/js/app.js` exists. Ideally, it should import your CSS as well, but if you don't want to, you can add [`addStyleEntry`](https://symfony.com/doc/current/frontend/encore/simple-example.html#compiling-only-a-css-file) to your Encore configuration.

```
// resources/js/app.js
import '../css/app.css';
```

Make sure you add `public/build/` (or whatever output path you set) to your `.gitignore`.

Last, but not least, you should replace the scripts in your `package.json` with the following:

```
// package.json
{
  "scripts": {
    "dev-server": "encore dev-server",
    "dev": "encore dev",
    "watch": "encore dev --watch",
    "build": "encore production --progress"
  }
}
```

Usage
-----

[](#usage)

In your blade components, use the `@styles` and `@scripts` directives to include the assets generated by Encore.

```

    Laravel

    @styles
    @scripts

    Hello.

```

By default, it will look for the `app` entries, but you can change them by passing an entry name in each directive.

```
@styles('app')
@scripts('admin')
```

If you used [static assets](https://symfony.com/doc/current/frontend/encore/copy-files.html), you can use `Encore::asset('build/path/to/your/asset.png')` to include it. Under the hood, it's just a mapping to the [manifest.json](https://symfony.com/doc/current/frontend/encore/versioning.html).

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~123 days

Recently: every ~153 days

Total

6

Last Release

1546d ago

PHP version history (3 changes)v0.1.0PHP ^7.2

v0.4.0PHP ^7.4

v0.5.0PHP ^7.4|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/f529e12119dd50e6be7d0d3ec1f74f917b1e9e5d30d5c4eeb41d331753387b13?d=identicon)[innocenzi](/maintainers/innocenzi)

---

Top Contributors

[![innocenzi](https://avatars.githubusercontent.com/u/16060559?v=4)](https://github.com/innocenzi "innocenzi (31 commits)")[![krissss](https://avatars.githubusercontent.com/u/10680903?v=4)](https://github.com/krissss "krissss (1 commits)")

---

Tags

laravel-encorewebpack-encoresymfonylaravellaravel-mixwebpack-encorelaravel-encore

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/innocenzi-laravel-encore/health.svg)

```
[![Health](https://phpackages.com/badges/innocenzi-laravel-encore/health.svg)](https://phpackages.com/packages/innocenzi-laravel-encore)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[zerodahero/laravel-workflow

Integerate Symfony Workflow component into Laravel.

204815.2k4](/packages/zerodahero-laravel-workflow)[brexis/laravel-workflow

Integerate Symfony Workflow component into Laravel.

283125.6k](/packages/brexis-laravel-workflow)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
