Webpack: Module build failed with jade-loader <p>This is likely a config issue, but I'm new to Webpack and haven't been able to figure it out after a few days. I'd appreciate some help! </p> <p><strong>Packages</strong></p> <ul> <li>webpack 1.9.8 </li> <li>jade-loader 0.7.1 </li> <li>jade 1.9.2 </li> </ul> <p><strong>webpack.config.js</strong></p> <pre><code>var webpack = require('webpack'); var path = require('path'); module.exports = { // ... resolve: { extensions: ["", ".webpack.js", ".web.js", ".json", ".js", ".jade" ], root: [ path.join(__dirname, 'src/js'), path.join(__dirname, 'node_modules') ], modulesDirectories: ['node_modules'], }, module: { loaders: [ { test: /\.json$/, loader: "json-loader" }, { test: /modernizr/, loader: "imports?this=&gt;window!exports?window.Modernizr" }, { text: /\.jade$/, loader: "jade-loader" } ] } // ... }; </code></pre> <p>With a completely empty entry file, I get the following error when trying to run webpack.</p> <pre><code>ERROR in ./~/jade/lib/runtime.js Module build failed: Error: unexpected token "indent" at MyParser.Parser.parseExpr (/Users/name/project/code/assets/node_modules/jade/lib/parser.js:252:15) at MyParser.Parser.parse (/Users/name/project/code/assets/node_modules/jade/lib/parser.js:122:25) at parse (/Users/name/project/code/assets/node_modules/jade/lib/index.js:104:21) at Object.exports.compileClientWithDependenciesTracked (/Users/name/project/code/assets/node_modules/jade/lib/index.js:256:16) at Object.exports.compileClient (/Users/name/project/code/assets/node_modules/jade/lib/index.js:289:18) at run (/Users/name/project/code/assets/node_modules/jade-loader/index.js:170:24) at Object.module.exports (/Users/name/project/code/assets/node_modules/jade-loader/index.js:167:2) @ ./entry.js 1:11-85 </code></pre> <p>If I actually require a jade file within entry.js, I get a different error:</p> <pre><code>ERROR in ./entry.js Module build failed: Error: unexpected text ; var at Object.Lexer.fail (/Users/name/project/code/assets/node_modules/jade/lib/lexer.js:871:11) at Object.Lexer.next (/Users/name/project/code/assets/node_modules/jade/lib/lexer.js:930:15) at Object.Lexer.lookahead (/Users/name/project/code/assets/node_modules/jade/lib/lexer.js:113:46) at MyParser.Parser.lookahead (/Users/name/project/code/assets/node_modules/jade/lib/parser.js:102:23) at MyParser.Parser.peek (/Users/name/project/code/assets/node_modules/jade/lib/parser.js:79:17) at MyParser.Parser.tag (/Users/name/project/code/assets/node_modules/jade/lib/parser.js:752:22) at MyParser.Parser.parseTag (/Users/name/project/code/assets/node_modules/jade/lib/parser.js:738:17) at MyParser.Parser.parseExpr (/Users/name/project/code/assets/node_modules/jade/lib/parser.js:211:21) at MyParser.Parser.parse (/Users/name/project/code/assets/node_modules/jade/lib/parser.js:122:25) at parse (/Users/name/project/code/assets/node_modules/jade/lib/index.js:104:21) </code></pre> <p>However, if I comment out the jade loader line in <code>webpack.config.js</code> and require the jade file with the inline syntax <code>require('jade!template.jade')</code> -- everything works okay.</p> <p>Any idea what's up?</p>