2017 © Pedro Peláez
 

library assets

image

webchemistry/assets

  • Thursday, June 14, 2018
  • by Antik
  • Repository
  • 1 Watchers
  • 0 Stars
  • 327 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 10 Versions
  • 2 % Grown

The README.md

Registration

extensions:
    assets: WebChemistry\Assets\DI\AssetsExtension

assets:
    resources:
        - %appDir%/assets.neon

Assets config

Example in app dir create assets.neon:, (*1)

## Front module
front:
  css:
    "compiled/front.min.css":
      - "css/*.css"
      - "plugins/bootstrap/css/bootstrap.css"
      - "plugins/forms/css/jquery.datetimepicker.css"
      - "plugins/forms/css/selectize.css"
      - "plugins/forms/css/selectize.default.css"
  js:
    "compiled/front.min.js":
      - "plugins/nette/netteForms.js"
      - "plugins/nette/nette.ajax.js"
      - "plugins/nette/extensions/spinner.ajax.js"
      - "plugins/jquery-nette-forms/libraries.js"
      - "plugins/jquery-nette-forms/errors.js"
      - "plugins/forms/js/inputmask.min.js"
      - "plugins/forms/js/inputmask.regex.extensions.min.js"
      - "plugins/forms/js/jquery.inputmask.min.js"
      - "plugins/forms/js/jquery.datetimepicker.js"
      - "plugins/forms/js/selectize.min.js"
      - "plugins/bootstrap/js/bootstrap.js"
      - "js/main.js"
    "compiled/front.header.min.js":
      - "plugins/jquery/jquery.min.js"

Presenter


class BasePresenter extends Nette\Application\UI\Presenter { use WebChemistry\Assets\TPresenter; }

Template

<head>
    {$assets->getCss('compiled/front.min.css')} <!-- Debug mode: all css files, production: only minified -->
    {$assets->getJs('compiled/front.head.min.js')}
</head>

Grunt task

package.json, (*2)

{
  "name": "Project",
  "version": "1.0.0",
  "devDependencies": {
    "grunt": "~0.4.5",
    "grunt-contrib-cssmin": "~0.14.0",
    "grunt-contrib-uglify": "~0.11.1",
    "grunt-nette-assets": "~0.1.0"
  },
  "dependencies": {}
}

Install:, (*3)

npm install

Gruntfile.js:, (*4)

module.exports = function(grunt) {
    grunt.config.init({
        netteAssets: {
            target: {
                config: 'app/resource.neon',
                basePath: 'www/'
            }
        }
    });

    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-cssmin');
    grunt.loadNpmTasks('grunt-nette-assets');

    return grunt.registerTask('default', ['netteAssets', 'uglify', 'cssmin']);
};

Run grunt:, (*5)

grunt

The Versions

14/06 2018

dev-master

9999999-dev

  Sources   Download

The Requires

 

26/07 2017

v2.0.2

2.0.2.0

  Sources   Download

The Requires

 

08/07 2017

v2.0.1

2.0.1.0

  Sources   Download

The Requires

 

08/06 2017

2.0

2.0.0.0

  Sources   Download

The Requires

 

20/06 2016

1.0.5

1.0.5.0

  Sources   Download

The Requires

 

16/06 2016

1.0.4

1.0.4.0

  Sources   Download

16/06 2016

1.0.3

1.0.3.0

  Sources   Download

08/03 2016

1.0.2

1.0.2.0

  Sources   Download

16/02 2016

1.0.1

1.0.1.0

  Sources   Download

10/02 2016

1.0

1.0.0.0

  Sources   Download