Skip to content
Mickael Daniel edited this page Apr 7, 2012 · 2 revisions

Plugin - script

This plugin runs, in the default setup, with the following configuration:

dom: {
  files                   : ['*.html'],
  options                 : {
    dir: process.cwd(),
    output: 'js/bundle.min.js'
  },
  'script[data-build]'    : h5bp.plugins.script
},

Does the following:

  1. Iterates through each script in order and concats them
  2. On the very last iteration (last script tags in jQuery collection), concat'd files are minified.
  3. The single minified content string is written to options.output or to the data-build attribute of last script tag.
  4. Every script in the collection but the last one get removed. Last one is updated so that the src attribute is src=path/to/output

Options

  • dir base directory to work from

  • output default output destination, if not defined through data-build.

» Home

» dom-based


» css

» js

Clone this wiki locally