PHPackages                             wavevision/nette-webpack - 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. [Framework](/categories/framework)
4. /
5. wavevision/nette-webpack

AbandonedArchivedLibrary[Framework](/categories/framework)

wavevision/nette-webpack
========================

Webpack adapter for Nette framework.

2.0.0(4y ago)49.0k↓50%1[10 PRs](https://github.com/wavevision/nette-webpack/pulls)MITPHPPHP &gt;=7.4

Since Feb 25Pushed 3y ago2 watchersCompare

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

READMEChangelogDependencies (13)Versions (38)Used By (0)

[![Wavevision s.r.o.](https://camo.githubusercontent.com/9479da35305d94b0244ac1c81fe283d0abb86fe217b2a815056165c67c0574e6/68747470733a2f2f77617665766973696f6e2e636f6d2f696d616765732f77617665766973696f6e2d6c6f676f2e706e67)](https://github.com/wavevision)

Nette Webpack
=============

[](#nette-webpack)

[![CI](https://github.com/wavevision/nette-webpack/workflows/CI/badge.svg)](https://github.com/wavevision/nette-webpack/actions/workflows/ci.yml)[![PHPStan](https://camo.githubusercontent.com/027fd636e970cf392fd4478baf3261048b41955d2905a95fb47da6bf19b8640a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7374796c652d6c6576656c2532306d61782d627269676874677265656e2e7376673f6c6162656c3d7068707374616e)](https://github.com/phpstan/phpstan)[![Coverage Status](https://camo.githubusercontent.com/36f6a819e138cc7474054464c383051a79c34d01a33f1c179f5153ba6e87beb7/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f77617665766973696f6e2f6e657474652d7765627061636b2f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/wavevision/nette-webpack?branch=master)[![Release](https://camo.githubusercontent.com/4e88e082c87bb34215c76c162180a1a12559f2e97f79ece658f86fc3b3f848b4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f7461672f77617665766973696f6e2f6e657474652d7765627061636b3f6c6162656c3d76657273696f6e26736f72743d73656d766572)](https://github.com/wavevision/nette-webpack/releases)

Webpack adapter for Nette framework consisting of:

- [DI extension](#di-extension)
- entry point chunks resolver **(uses webpack `manifest.json`)**
- UI components to render assets `` and `` tags
- [webpack config helper](#webpack-helper) to manage your setup consistently with `neon` files

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

[](#installation)

Install the DI extension via [Composer](https://getcomposer.org).

```
composer require wavevision/nette-webpack
```

The webpack helper can be installed via [Yarn](https://yarnpkg.com)

```
yarn add --dev @wavevision/nette-webpack
```

or [npm](https://npmjs.com)

```
npm install --save-dev @wavevision/nette-webpack
```

Usage
-----

[](#usage)

### DI extension

[](#di-extension)

Register DI extension in your app config.

```
extensions:
    webpack: Wavevision\NetteWebpack\DI\Extension(%debugMode%, %consoleMode%)
```

You can configure the extension as follows *(default values)*.

```
webpack:
    debugger: %debugMode%
    devServer:
        enabled: %debugMode%
        url: http://localhost:9006
    dir: %wwwDir%/dist
    dist: dist
    entries: []
    manifest: manifest.json
```

- **`debugger: boolean`** – enable [Tracy](https://github.com/nette/tracy) panel with useful development information
- **`devServer.enabled: boolean`** – serve assets from `webpack-dev-server`
- **`devServer.url: string`** – `webpack-dev-server` public URL
- **`dir: string`** – absolute path to webpack build directory
- **`dist: string`** – webpack build directory name
- **`entries: Record`** – webpack entry points that should be considered when resolving assets
- **`manifest: string`** – webpack manifest name

Then, setup entry chunks.

```
use Nette\Application\UI\Presenter;
use Wavevision\NetteWebpack\InjectResolveEntryChunks;
use Wavevision\NetteWebpack\UI\Components\Assets\AssetsComponent;

final class AppPresenter extends Presenter
{

    use AssetsComponent;
    use InjectResolveEntryChunks;

    public function actionDefault(): void
    {
        $this
            ->getAssetsComponent()
            ->setChunks($this->resolveEntryChunks->process('entry'));
    }
}
```

> **Note:** Entry chunks are resolved based on webpack `manifest.json`. You can also set chunks manually and/or separately with `setScripts` and `setStyles` methods.

Finally, render `assets` in your layout.

```

		Wavevision Nette Webpack
		{control assets:styles}

		{include content}
		{control assets:scripts}

```

Should you need it, you can inject and use following services to further customize your setup:

- [`NetteWebpack`](./src/NetteWebpack/NetteWebpack.php) – provides basic methods to work with the extension
- [`FormatAssetName`](./src/NetteWebpack/FormatAssetName.php) – formats and resolves asset URL based on provided name
- [`FormatChunkName`](./src/NetteWebpack/FormatChunkName.php) – formats chunk names for specific content types and resolves their URL

### Webpack helper

[](#webpack-helper)

This simple utility will help you to manage your project setup and webpack configs consistently. It will also provide you with pre-configured [webpack-manifest-plugin](https://github.com/danethurber/webpack-manifest-plugin) to generate `manifest.json`with extra `chunks` property that is used to dynamically resolve entry chunks in your application.

```
import { WebpackHelper } from '@wavevision/nette-webpack';
```

The helper constructor accepts following arguments:

- **`neonPath?: string`** – path to a `neon` in which `webpack` is configured (if not provided, default values will be used)
- **`wwwDir: string`** – mandatory path to application `wwwDir`
- **`manifestOptions?: WebpackManifestPlugin.Options`** – if you need to customize manifest plugin setup, you can do it here

The returned class exposes following methods:

- **`createManifestPlugin(): WebpackManifestPlugin`** – creates manifest plugin instance
- **`getDevServerPublicPath(): string`** – returns resolved `webpack-dev-server` URL with `dist` included in path
- **`getDevServerUrl(): UrlWithParsedQuery`** – returns `webpack-dev-server` parsed URL object
- **`getDist(): string`** – returns `dist` parameter
- **`getEntries(): Record`** – returns records of configured webpack entries
- **`getEnabledEntries(): string[]`** – returns list of webpack entries that have `true` configured
- **`getManifest(): string`** – returns webpack manifest file name
- **`getOutputPath(): string`** – returns resolved path to webpack output directory
- **`parseNeonConfig(): T`** – returns parsed `neon` config (throws error if `neonPath` is not defined)

> **Note:** You can also import `Neon` helper if you want to parse and work with more `neon` files.

See [example webpack config](./examples/webpack.config.ts) to see it all in action.

Credits
-------

[](#credits)

Many️ 🙏 to [Jiří Pudil](https://github.com/jiripudil) for his [WebpackNetteAdapter](https://github.com/o2ps/WebpackNetteAdapter) which we used in our projects and served as an inspiration for this library.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 94.6% 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 ~25 days

Recently: every ~88 days

Total

25

Last Release

1673d ago

Major Versions

0.7.1 → 1.0.02020-11-02

1.0.3 → 2.0.02021-10-19

### Community

Maintainers

![](https://www.gravatar.com/avatar/3af21e3a334be19fe9e3355c0d300a8a41e63322103aa24929e745d7cac6c965?d=identicon)[rozsival](/maintainers/rozsival)

![](https://www.gravatar.com/avatar/64a880caaffe510a647f7ae7da515846fc661fe10744b17a981ddbc47bbae4df?d=identicon)[jfilla](/maintainers/jfilla)

---

Top Contributors

[![rozsival](https://avatars.githubusercontent.com/u/7785240?v=4)](https://github.com/rozsival "rozsival (88 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")

---

Tags

adapterdi-extensionextensionnettenette-webpackwebpackwebpack-helper

### Embed Badge

![Health badge](/badges/wavevision-nette-webpack/health.svg)

```
[![Health](https://phpackages.com/badges/wavevision-nette-webpack/health.svg)](https://phpackages.com/packages/wavevision-nette-webpack)
```

###  Alternatives

[nette/nette

👪 Nette Framework - innovative framework for fast and easy development of secured web applications in PHP (metapackage)

1.6k2.8M335](/packages/nette-nette)[nette/web-project

Nette: Standard Web Project

10991.8k](/packages/nette-web-project)[nextras/mail-panel

MailPanel is extension for Nette Framework which captures sent e-mails in development mode and shows them in debugger bar.

741.2M4](/packages/nextras-mail-panel)[tomaj/nette-api

Nette api

36261.8k4](/packages/tomaj-nette-api)

PHPackages © 2026

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