Skip to content

Instantly share code, notes, and snippets.

@joshuacrass
Last active September 10, 2018 10:23
Show Gist options
  • Save joshuacrass/5870e04927d476ec5dfe7e22189c26ab to your computer and use it in GitHub Desktop.
Save joshuacrass/5870e04927d476ec5dfe7e22189c26ab to your computer and use it in GitHub Desktop.
react-starter Webpack paths.js config file
// paths.js
// Paths will export some path variables that we'll
// use in other Webpack config and server files
const path = require("path");
const fs = require("fs");
const appDirectory = fs.realpathSync(process.cwd());
const resolveApp = relativePath => path.resolve(appDirectory, relativePath);
module.exports = {
appAssets: resolveApp("src/assets"), // For images and other assets
appBuild: resolveApp("build"), // Prod built files end up here
appConfig: resolveApp("config"), // App config files
appHtml: resolveApp("src/index.html"),
appIndexJs: resolveApp("src/index.jsx"), // Main entry point
appSrc: resolveApp("src") // App source
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment