# All files / src/webpack/inc webpack-resolver-config.js

100% Statements 9/9
50% Branches 2/4
100% Functions 0/0
100% Lines 9/9

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    312x
    2x
    2x

    2x
    2x
    2x

    2x
    2x

    2x

     const fs = require("fs");
    const path = require("path");
    const directories = require("../utils/directories");

    const emptyClass = path.resolve(process.env.__lib_root, "src", "webpack", "utils", "emptyClass.js");
    const projectClientPath = `${process.env.__project_root}/src/client.js`;
    const projectClientExists = fs.existsSync(projectClientPath);

    const projectServerPath = `${process.env.__project_root}/src/server.js`;
    const projectServerExists = fs.existsSync(projectServerPath);

    module.exports = module.exports.default = {
      resolve: {
        alias: {
          pawjs: path.resolve(path.join(process.env.__lib_root)),
          pawProjectClient: projectClientExists? projectClientPath: emptyClass,
          pawProjectServer: projectServerExists? projectServerPath: emptyClass
        },
        modules: [
          path.resolve(path.join(directories.root, "node_modules")),
          path.resolve(path.join(process.env.__lib_root, "node_modules")),
        ]
      },
      resolveLoader: {
        modules: [
          path.resolve(path.join(directories.root, "node_modules")),
          path.resolve(path.join(process.env.__lib_root, "node_modules")),
          path.resolve(path.join(process.env.__lib_root, "src", "webpack", "loaders"))
        ]
      }
    };