Download the PHP package goldenplanetdk/symfony-webpack without Composer

On this page you can find all versions of the php package goldenplanetdk/symfony-webpack. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package symfony-webpack

Build Status Coverage Status


Installation

Usage

Run

Documentation

Installation

Add to AppKernel:

Generate webpack.symfony.config.js and install dependencies:


Usage

Twig function and tag

You can choose between webpack_asset function and webpack tag

webpack_asset function

type is js or css, leave null to guess the type. For css this function could return null if no CSS would be extracted from provided entry point. If you are sure that there will be some CSS, you could just ignore this. Otherwise, you could use webpack tag as it handles this for you (omits the <link/> tag entirely in that case).

webpack tag

As with webpack_asset function, provide js, css or leave it out to guess the type.

See usage with named and group in Commons chunk section.

Keep in mind that you must provide hard-coded asset paths in both tag and function. This is to find all available assets in compile-time.

Scripts and Stylesheets

Single entry point (.js, .ts, .coffee etc.) in twig templates:

Note: here @acmeHello is equal to @AcmeHelloBundle/Resources/assets

Multiple entry points:

To avoid having a link element with an empty href in the DOM when the script may possibly not emit a stylesheet, test the value returned from webpack_asset before inserting the link element:

Commons chunk

This bundle supports both single and several commons chunks, but you have to configure this explicitly.

In your webpack.config.js:

In your base template:

You can also use webpack_named_asset twig function instead of webpack tags.

Named commons chunk

In webpack configuration it is allowed to put commonly used libraries (shared dependencies) in a separate file, while still having reference to the same singleton library when using require. For example, to put jquery and lodash to a separate file (a commons chunk) add following to your webpack.symfony.config.js:

Then add the script that will load the common libs before any other script that may depend on it. Use the webpack_named_asset function to inject the actual compiled asset path:

Commons chunk may contain other type of assets:

The rendered output of above in production mode will be something like:

Webpack can also be configured to determine the commonly used libraries in multiple entry points automatically. Support for these is planned.

Other resource types

You can pass any kind of resources to webpack with webpack_asset function for single entry point:

Or with webpack tag for multiple entry points:

Requiring within scripts and stylesheets

Inside script.js:

Inside stylesheet.css, less, sass or stylus:


Compile

Using Symfony app/console to run webpack commands

Compile for dev environment:

Watch for changes and compile

Watch for changes, compile and automatically reload browser tab(s)

Compile as part of deployment in production environment:


Documentation

Full documentation is available at Wiki pages of this repository


All versions of symfony-webpack with dependencies

PHP Build Version
Package Version
Requires maba/dependency-injection-extra Version ^0.1.1
php Version >=5.6
satooshi/php-coveralls Version ^1.0
symfony/console Version ^2.5|^3.0
symfony/dependency-injection Version ^2.6|^3.0
symfony/framework-bundle Version ^2.7|^3.0
symfony/monolog-bundle Version ^2.3|^3.0
symfony/process Version ^2.5|^3.0
symfony/routing Version ^2.7|^3.0
symfony/templating Version ^2.1|^3.0
symfony/twig-bundle Version ^2.3|^3.0
twig/twig Version ^1.27|^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package goldenplanetdk/symfony-webpack contains the following files

Loading the files please wait ....