Skip to content

Instantly share code, notes, and snippets.

@zsitro
Last active August 29, 2015 14:07
Show Gist options
  • Save zsitro/fe732c9afe3ef74b135b to your computer and use it in GitHub Desktop.
Save zsitro/fe732c9afe3ef74b135b to your computer and use it in GitHub Desktop.
require('./content.js')
console.log("entry.")
# 1.bundle.js
require.ensure ["./input.coffee", "./module-b.coffee"], (require) ->
a = require("./module-b.coffee");
# 2.bundle.js
require.ensure ["./input-2.coffee", "./module-c.coffee", "./module-b.coffee"], (require) ->
a = require("./module-c.coffee");
as = require("./module-b.coffee");
var CommonsChunkPlugin = require("webpack/lib/optimize/CommonsChunkPlugin");
module.exports = {
entry: "./entry.coffee",
output: {
path: __dirname,
filename: "bundle.js"
},
module: {
loaders: [
{ test: /\.css$/, loader: "style!css" },
{ test: /\.coffee$/, loader: "coffee-loader" },
{ test: /\.(coffee\.md|litcoffee)$/, loader: "coffee-loader?literate" }
]
},
plugins: [
new CommonsChunkPlugin("commons.chunk.js")
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment