DocPad plugin to bundle CommonJS/AMD/Labeled Modules with webpack.
$ docpad install webpack
Reference the webpack configuration for a full understanding of webpack. The below is only an introduction to how to use it with DocPad:
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
Create a file
src/documents/content.js with the following content:
moduleexports = "It works from content.js.";
entry.js to make use of it:
---webpack: true---var content = require"./content.js";console.logcontent;
Rebuilding with DocPad will bundle both
plugins:webpack:verbose: falsedebug: true
It is also possible to pass the options through on a document-basis:
---webpack:verbose: falsedebug: true---var myfile = require'./myfile';console.logmyfile;
These amazing people are maintaining this project:
- Rob Loach (http://robloach.net)
No sponsors yet! Will you be the first?
These amazing people have contributed code to this project:
Copyright © Rob Loach (http://robloach.net)