Why is webpack trying to display my readme.md files

Webpack is throwing errors shown below. The assembly seems to work, but what gives?

WARNING c. / {snip }/readme.md Parse error: C: {snip} \ readme.md Unexpected token (1: 7) This file type may require an appropriate downloader to process.

I couldn't find a way to ignore the files. I don't even know why it is trying to display these files.

Here are some parts of my webpack settings file:

module: {
    loaders: [
        {test: /\.hb.html$/, loader: "handlebars-loader/?helperDirs[]=" + __dirname + "/src/handlebarsHelpers"},
        { test: /\.tsx?$/, loader: "ts-loader?" + JSON.stringify({
            transpileOnly: true
        })}
    ]
},

      

entry:

entry: "./src/userlane.ts",

      

and

resolve: {
    extensions: ["", ".webpack.js", ".web.js", ".ts", ".tsx", ".js"],

      

I tried excluding .md files in typescript config file, also didn't work.

+3


source to share


1 answer


The problem wasn't with the settings, but that my code had query expressions like this:

exports.getModule = function (moduleName) {
    var mod = require('./' + moduleName + '');
    return mod;
};

      



This made webpack try to download all files, not just those in the entry point dependency tree.

+3


source







All Articles