Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
:pencil2: Bundle CommonJs/AMD Modules using webpack
CoffeeScript JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
src
test
.editorconfig
.gitignore
.jshintrc
.npmignore
.travis.yml
CONTRIBUTING.md
Cakefile
HISTORY.md
LICENSE.md
README.md
coffeelint.json
package.json

README.md

webpack Plugin for DocPad

Build Status NPM version NPM downloads Dependency Status
Gratipay donate button Flattr donate button

DocPad plugin that allows bundling CommonJs/AMD/Labeled Modules for the browser using webpack.

Install

$ docpad install webpack

Usage

Reference the webpack configuration for a full understanding of webpack. The below is only an introduction to how to use it with DocPad:

Entry

Create a src/documents/entry.js file as your webpack entry point to your application.

---
webpack: true
---
console.log("It works.");

When building with DocPad, webpack will compile the bundles to out/entry.js.

Second file

Create a file src/documents/content.js with the following content:

module.exports = "It works from content.js.";

Modify entry.js to make use of it:

---
webpack: true
---
var content = require("./content.js");
console.log(content);

Rebuilding with DocPad will bundle both entry.js and content.js in entry.js.

Configuration

The default configuration for this plugin is the equivalant of adding the following webpack config to your DocPad configuration file:

plugins:
    webpack:
        verbose: false
        debug: true

It is also possible to pass the options through on a document-basis:

---
webpack:
    verbose: false
    debug: true
---
var myfile = require('./myfile');
console.log(myfile);

History

Discover the change history by heading on over to the HISTORY.md file.

Contribute

Discover how you can contribute by heading on over to the CONTRIBUTING.md file.

Backers

Maintainers

These amazing people are maintaining this project:

Sponsors

No sponsors yet! Will you be the first?

Gratipay donate button Flattr donate button

Contributors

These amazing people have contributed code to this project:

Become a contributor!

License

Licensed under the incredibly permissive MIT license

Copyright © Rob Loach (http://robloach.net)

Something went wrong with that request. Please try again.