Skip to content

Instantly share code, notes, and snippets.

@IngwiePhoenix
Last active February 8, 2016 20:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IngwiePhoenix/7d4fb5cbd70614f496d6 to your computer and use it in GitHub Desktop.
Save IngwiePhoenix/7d4fb5cbd70614f496d6 to your computer and use it in GitHub Desktop.
var html = require("./basic.html")
console.log(html);
<!DOCTYPE html>
<html>
<head>
<!-- ... -->
</head>
<body>
Here is my pretty avatar!
<img src="./IngwiePhoenix.png">
</body>
</html>
module.exports = {
entry: "./app.js",
output: {
filename: "[name].js",
path: "./out"
},
module: {
loaders: [
{
test: /\.png$/,
loaders: [
// I know that my avatar is 14kb of size.
// Setting limit to 0 causes it to be inlined.
// Try setting it to something like 1024*15 :)
"url?limit=0",
// Standard options for image-loader...not going to go too fancy.
"image-webpack"
]
}, {
test: /\.html$/,
loader: "html"
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment