Skip to content
Example for Yii 2 asset modularization
PHP JavaScript CSS Shell Other
Branch: master
Clone or download
Latest commit 9e848e6 Aug 2, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
backend added example files Apr 7, 2019
common added example files Apr 7, 2019
console added example files Apr 7, 2019
environments added example files Apr 7, 2019
frontend remove build files Aug 2, 2019
js added example files Apr 7, 2019
scss added example files Apr 7, 2019
vagrant added example files Apr 7, 2019
.bowerrc added example files Apr 7, 2019
.gitignore added example files Apr 7, 2019
LICENSE added example files Apr 7, 2019
LICENSE.md
README.md added example files Apr 7, 2019
Vagrantfile added example files Apr 7, 2019
asset_config.js added example files Apr 7, 2019
codeception.yml added example files Apr 7, 2019
composer.json added example files Apr 7, 2019
composer.lock added example files Apr 7, 2019
docker-compose.yml added example files Apr 7, 2019
gulpfile.js added example files Apr 7, 2019
init added example files Apr 7, 2019
init.bat added example files Apr 7, 2019
package-lock.json security fix, ignore build files Aug 2, 2019
package.json security fix, ignore build files Aug 2, 2019
pipelines.js added example files Apr 7, 2019
requirements.php added example files Apr 7, 2019
yii.bat

README.md

yii2-asset-modularization-example

Example for Yii 2 asset modularization

Testing the example

In order to test the example you will need nodejs 8+ and composer installed on the computer you are testingo on.

To install and run this example download this code and then run:

  1. npm ci
  2. composer install
  3. npm run build
  4. ./yii test - This will start the test server.

After this is running you will be able to access the site on http://localhost:8080

Notes

  • All apps "global" SCSS files are supposed to be in scss folder.
  • All apps "global" JS files are supposed to be in js folder.
  • Checkout frontend/views/site/index.php to see example of using the modularized approach to views.
  • All bundles which are overridden are listed in frontend/config/bundle_remaps.php
  • To watch for changes and rebuild automatically run npm start
  • To run minified version of the build run npm run deploy
  • All minified assets are in frontend/web/build
You can’t perform that action at this time.