Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion packages/gatsby/src/utils/webpack-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,13 @@ module.exports = async ({
stage: Stage,
program: any,
}): Promise<WebpackUtilsOptions> => {
const assetRelativeRoot = `static/`
/**
* the leading `../` for assetRelativeRoot is required to ensure
* the static files extracted by webpack are not part of the
* "build-javascript" output path of `/js`. The same technique is
* used for CSS
*/
const assetRelativeRoot = `../static/`
Copy link
Contributor Author

@brotzky brotzky Jul 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@m-allanson This had to be treated the same way as the ../css/ case because of how there's only a build-javascript stage. #6346 (comment)

Here are all the build stages:

type Stage = "develop" | "develop-html" | "build-javascript" | "build-html"

I think in the future it could be a good idea to add discrete build stages for CSS (although CSS in JS makes this a question mark?) and static assets instead of relying on this current workaround.

Here's an example of the output folder of your example repository with this commit

screen shot 2018-07-12 at 7 00 45 pm

const vendorRegex = /(node_modules|bower_components)/
const supportedBrowsers = program.browserlist

Expand Down