DocPad plugin to bundle CommonJS/AMD/Labeled Modules with webpack.
npm install docpad-plugin-webpack
|4||downloads in the last month|
|Version||2.1.0 last updated a month ago|
|Keywords||docpad, docpad-plugin, 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:
module.exports = "It works from content.js.";
entry.js to make use of it:
--- webpack: true --- var content = require("./content.js"); console.log(content);
Rebuilding with DocPad will bundle both
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);
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)