PHPackages                             nemo64/webpack-environment - 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. nemo64/webpack-environment

AbandonedArchivedLibrary

nemo64/webpack-environment
==========================

01PHP

Since May 7Pushed 8y ago1 watchersCompare

[ Source](https://github.com/Nemo64/webpack-environment)[ Packagist](https://packagist.org/packages/nemo64/webpack-environment)[ RSS](/packages/nemo64-webpack-environment/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/db531f8f430080c8d4745c37fecb305a0b4cb7b4b797105bc1a65c11e5443f92/68747470733a2f2f706f7365722e707567782e6f72672f6e656d6f36342f7765627061636b2d656e7669726f6e6d656e742f762f737461626c65)](https://packagist.org/packages/nemo64/webpack-environment)[![Total Downloads](https://camo.githubusercontent.com/46e85a7e4b9cffe63c36ce7d261587532ec62ce0674b987c292e9ee6645083b7/68747470733a2f2f706f7365722e707567782e6f72672f6e656d6f36342f7765627061636b2d656e7669726f6e6d656e742f646f776e6c6f616473)](https://packagist.org/packages/nemo64/webpack-environment)[![License](https://camo.githubusercontent.com/b2d4fa51f146b5e3473a68dbc4e725632e86f34b2dfd11019bb20622aff91e20/68747470733a2f2f706f7365722e707567782e6f72672f6e656d6f36342f7765627061636b2d656e7669726f6e6d656e742f6c6963656e7365)](https://packagist.org/packages/nemo64/webpack-environment)

Webpack environment
===================

[](#webpack-environment)

This is an extension to [nemo64/environment](https://github.com/Nemo64/environment) which adds a default webpack file and some configuration to the Makefile and docker configuration to easily set up a webpack in your php project.

There aren't any further local dependencies. Every node execution is run through docker.

How to install
--------------

[](#how-to-install)

Just run `composer require --dev nemo64/webpack-environment` and the files are there. You'll also need to implement the `manifest.json` ([read more](https://www.npmjs.com/package/webpack-manifest-plugin)) in your application.

How it works
------------

[](#how-it-works)

Webpack will be executed as a docker service.

```
services:
  webpack:
    image: 'node:carbon'
    command: 'yarn run encore dev-server --host 0.0.0.0 --port 8080'
    ports:
      8080:8080
    volumes:
      - '.:/var/www'
    working_dir: /var/www
```

The makefile will be extended with this install job

```
node_modules: docker-compose.log $(wildcard package.* yarn.*)
	docker-compose run --rm --no-deps webpack yarn install
```

Example file
------------

[](#example-file)

If you want to experiment with webpack just use this `index.php` file.

```
