Skip to content

Commit 3f97ecc

Browse files
committed
Give the possibility to add a --output website for build and develop commands
1 parent 10a1faf commit 3f97ecc

File tree

37 files changed

+545
-9138
lines changed

37 files changed

+545
-9138
lines changed

docs/docs/building-with-components.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ import favicon from "./favicon.png";
163163
let inlinedStyles = "";
164164
if (process.env.NODE_ENV === "production") {
165165
try {
166-
inlinedStyles = require("!raw-loader!../public/styles.css");
166+
inlinedStyles = require(`!raw-loader!../${process.env.GATSBY_OUTPUT_DIR}/styles.css`);
167167
} catch (e) {
168168
console.log(e);
169169
}

docs/docs/environment-variables.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,4 @@ Reserved environment variables:
7171

7272
* `NODE_ENV`
7373
* `PUBLIC_DIR`
74+
* `GATSBY_OUTPUT_DIR`

examples/client-only-paths/src/html.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import typography from "./utils/typography"
66
let stylesStr
77
if (process.env.NODE_ENV === `production`) {
88
try {
9-
stylesStr = require(`!raw-loader!../public/styles.css`)
9+
stylesStr = require(`!raw-loader!../${process.env.OUTPUT_DIRECTORY}/styles.css`)
1010
} catch (e) {
1111
console.log(e)
1212
}

examples/using-postcss-sass/src/html.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const typography = new Typography()
88
let stylesStr
99
if (process.env.NODE_ENV === `production`) {
1010
try {
11-
stylesStr = require(`!raw-loader!../public/styles.css`)
11+
stylesStr = require(`!raw-loader!../${process.env.GATSBY_OUTPUT_DIR}/styles.css`)
1212
} catch (e) {
1313
console.log(e)
1414
}

examples/using-remark/src/html.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import typography from "./utils/typography"
66
let stylesStr
77
if (process.env.NODE_ENV === `production`) {
88
try {
9-
stylesStr = require(`!raw-loader!../public/styles.css`)
9+
stylesStr = require(`!raw-loader!../${process.env.GATSBY_OUTPUT_DIR}/styles.css`)
1010
} catch (e) {
1111
console.log(e)
1212
}

examples/using-sass/src/html.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const typography = new Typography()
88
let stylesStr
99
if (process.env.NODE_ENV === `production`) {
1010
try {
11-
stylesStr = require(`!raw-loader!../public/styles.css`)
11+
stylesStr = require(`!raw-loader!../${process.env.GATSBY_OUTPUT_DIR}/styles.css`)
1212
} catch (e) {
1313
console.log(e)
1414
}

examples/using-styled-components/src/html.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import typography from "./utils/typography"
66
let stylesStr
77
if (process.env.NODE_ENV === `production`) {
88
try {
9-
stylesStr = require(`!raw-loader!../public/styles.css`)
9+
stylesStr = require(`!raw-loader!../${process.env.GATSBY_OUTPUT_DIR}/styles.css`)
1010
} catch (e) {
1111
console.log(e)
1212
}

examples/using-styletron/src/html.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import typography from "./utils/typography"
66
let stylesStr
77
if (process.env.NODE_ENV === `production`) {
88
try {
9-
stylesStr = require(`!raw-loader!../public/styles.css`)
9+
stylesStr = require(`!raw-loader!../${process.env.GATSBY_OUTPUT_DIR}/styles.css`)
1010
} catch (e) {
1111
console.log(e)
1212
}

examples/using-stylus/src/html.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const typography = new Typography()
88
let stylesStr
99
if (process.env.NODE_ENV === `production`) {
1010
try {
11-
stylesStr = require(`!raw-loader!../public/styles.css`)
11+
stylesStr = require(`!raw-loader!../${process.env.GATSBY_OUTPUT_DIR}/styles.css`)
1212
} catch (e) {
1313
console.log(e)
1414
}

examples/using-typescript/src/html.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import * as React from "react";
77
let styles: string;
88
if (process.env.NODE_ENV === `production`) {
99
try {
10-
styles = require("!raw-loader!../public/styles.css");
10+
styles = require("!raw-loader!../${process.env.GATSBY_OUTPUT_DIR}/styles.css");
1111
} catch (err) {
1212
console.log(err);
1313
}

0 commit comments

Comments
 (0)