GithubHelp home page GithubHelp logo

robloach / docpad-plugin-webpack Goto Github PK

View Code? Open in Web Editor NEW
8.0 3.0 4.0 251 KB

:pencil2: Bundle CommonJs/AMD Modules using webpack

Home Page: http://webpack.github.io

License: Other

CoffeeScript 64.84% JavaScript 32.77% CSS 0.42% HTML 1.97%

docpad-plugin-webpack's Introduction

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 equivalent 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)

docpad-plugin-webpack's People

Contributors

robloach avatar sokra avatar vsopvsop avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.