Adding Trussworks USWDS React Wrapper (#67)

* removing unused js
* Working for first load, second raises 'failed to SSR' without DEV_SSR enabled. We will need to fix this before prod
This commit is contained in:
Nat Hillard 2021-05-20 21:54:08 -04:00 committed by GitHub
commit 13a4e5f47a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 1036 additions and 256 deletions

16
client/gatsby-node.js Normal file
View file

@ -0,0 +1,16 @@
// Disable references to window from trussworks/uswds
// See here: https://www.gatsbyjs.com/docs/debugging-html-builds/#fixing-third-party-modules
exports.onCreateWebpackConfig = ({ stage, loaders, actions }) => {
if (stage === "build-html" || stage === "develop-html") {
actions.setWebpackConfig({
module: {
rules: [
{
test: /@trussworks\/react-uswds/,
use: loaders.null(),
},
],
},
})
}
}