Download the PHP package maba/webpack-migration-bundle without Composer

On this page you can find all versions of the php package maba/webpack-migration-bundle. 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 webpack-migration-bundle

Bundle to Help Migrating From Assetic to Webpack

Bundle to help integrating from assetic to webpack.

It uses maba/webpack-bundle and symfony/assetic-bundle as dependencies.

It creates and modifies files in your repository. This means that it is not meant to be run in production - install it, use it and remove it from your project. Always keep sure to use version system like git and have no uncommitted changes as you might loose your stuff.

What is webpack and why to migrate from assetic?

Webpack is module bundler and CommonJS / AMD dependency manager.

For me, it replaces both grunt/gulp and RequireJS.

See what is webpack? and it's documentation for more information.

For comparison with assetic and alternative webpack-based solutions, see maba/webpack-bundle.

What does this bundle do?

  1. Finds assetic nodes (stylesheets and javascripts nodes) in your twig templates.
  2. Dumps js files representing bundled assets.
  3. Replaces them with webpack_asset function with reference to dumped file.
  4. Dumps configured named assets inside config.yml.

twig-template-modification-bundle is used for replacing the twig templates themselves.

Worth to note that it does support assetic variables, but as the result is usable, it's not really manageable in the long scale. Please see other means to accomplish this with conditional loading from the javascript itself. See symfony-webpack-angular-demo for an example how this could be done with locales.

Also worth to note that it ignores images assetic nodes and other nodes with unrecognised filters. You can configure ignored filters in config.yml by providing maba_webpack_migration.ignored_filters parameter.

By default, these filters are ignored:

They are ignored, as js and css files are minified by default on production, and SCSS and Less files work out of the box. Assumption is made that you use correct extension for your file types (.less for Less files etc.)

Installation and Usage

Inside AppKernel:

Setup files for webpack bundle (see maba/webpack-bundle for more information what this does):

Configure webpack to extract CSS into separate files. This is needed for stylesheets tags to work.

Install npm dependencies used by WebpackMigrationBundle which are not installed by default in WebpackBundle:

In webpack context, this is not window like when adding common <script> tag, this points to module.exports. This is handled by default by most libraries and when running in such mode, no variables are registered in global context (window), they are just exported in CommonJS way.

This breaks things, as your current code expects to find jQuery, angular etc. in global context.

This bundle analyses JavaScript file for common patterns and tries to use correct loaders to fix these issues. This might not always work out-of-the-box. You can always use additional loader or modify the generated code - bundle only creates and replaces files in your repository, all other modifications to the code after that can be made manually.

Run replacement command:

Now your twig files are modified - you can safely remove both bundles (this one and MabaTwigTemplateModificationBundle) from your kernel and vendors. You can just revert your changes in AppKernel.php, composer.json and composer.lock, asserting that you've installed MabaWebpackBundle separately.

Running tests

Travis status


All versions of webpack-migration-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.2
maba/webpack-bundle Version ^0.3.0
maba/twig-template-modification-bundle Version ^1.0.1
symfony/assetic-bundle Version ^2.6
symfony/framework-bundle Version ^2.6||^3
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 maba/webpack-migration-bundle contains the following files

Loading the files please wait ....