Skip to content

Commit

Permalink
chore: changes needed for Netlify PR previews (#500)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbadan authored Apr 12, 2019
1 parent 36fff3b commit ed2f189
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion config/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function ensureSlash(inputPath, needsSlash) {
}

const getPublicUrl = appPackageJson =>
envPublicUrl || process.env.BUILD_ENV !== 'development' ? require(appPackageJson).homepage : '';
envPublicUrl || process.env.BUILD_ENV !== 'development' && process.env.NETLIFY !== 'true' ? require(appPackageJson).homepage : '';

// We use `PUBLIC_URL` environment variable or "homepage" field to infer
// "public path" at which the app is served.
Expand Down
10 changes: 10 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Global settings applied to the whole site.
#
# “publish” is the directory to publish (relative to root of your repo),
# “command” is your build command,
# “base” is directory to change to before starting build. if you set base:
# that is where we will look for package.json/.nvmrc/etc not repo root!

[build]
publish = "build"
command = "npm run build-doc:netlify"
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"scripts": {
"build-css": "node-sass-chokidar --include-path ./src --include-path ./node_modules src/ -o src/",
"build-doc": "node scripts/build.js && cp build/index.html build/404.html",
"build-doc:netlify": "npm run build && NETLIFY=true npm run build-doc",
"build-js": "node scripts/build.js",
"build:lint:fix": "npm run build:lint -- --fix",
"build:lint": "eslint 'src/**' --ext .js,.jsx --env browser,node",
Expand Down

0 comments on commit ed2f189

Please sign in to comment.