dot loader for webpack Usage Documentation: Using loaders var template = require("dot!./file.dot"); // => returns file.dot compiled as template function Recommended config module.exports = { module: { loaders: [ { test: /\.dot$/, loader: "dot-loader" } ] } }; Then you only need to write: require("./file.dot")