2021-05-20 23:59:20 -04:00
|
|
|
path = require('path');
|
|
|
|
|
2021-05-20 21:54:08 -04:00
|
|
|
// 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 }) => {
|
2021-05-20 23:59:20 -04:00
|
|
|
actions.setWebpackConfig({
|
|
|
|
devtool: 'eval-source-map',
|
|
|
|
});
|
|
|
|
if (stage === "build-html" || stage === "develop-html") {
|
2021-05-20 21:54:08 -04:00
|
|
|
actions.setWebpackConfig({
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /@trussworks\/react-uswds/,
|
|
|
|
use: loaders.null(),
|
|
|
|
},
|
|
|
|
],
|
2021-05-21 10:57:20 -04:00
|
|
|
}
|
2021-05-20 21:54:08 -04:00
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|