const path = require("path");
const paths = require("../paths");

function getResolveModules() {
  const modules = ["node_modules"];
  const { getCoreLibraryNodeModulesPath } = require("../utils/coreLibrary");
  const coreLibraryNodeModules = getCoreLibraryNodeModulesPath();
  if (coreLibraryNodeModules) {
    modules.push(coreLibraryNodeModules);
  }
  return modules;
}

module.exports = {
  modules: getResolveModules(),
  alias: {
    "~": path.resolve(__dirname, paths.frontend.src.base),
    assets: path.resolve(__dirname, paths.frontend.src.assets),
    components: path.resolve(__dirname, paths.frontend.src.components),
    config: path.resolve(__dirname, paths.frontend.src.config),
    layouts: path.resolve(__dirname, paths.frontend.src.layouts),
    routes: path.resolve(__dirname, paths.frontend.src.routes),
    utils: path.resolve(__dirname, paths.frontend.src.utils),
    vendor: path.resolve(__dirname, paths.frontend.src.vendor),
  },
};
