Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Commit

Permalink
removed source-maps
Browse files Browse the repository at this point in the history
  • Loading branch information
eduard-deriv committed Jan 16, 2024
1 parent 953800d commit b3bf4a2
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,25 +399,14 @@ const style_lint_options = {

exports.onCreateWebpackConfig = ({ stage, actions, loaders, getConfig }, { ...options }) => {
const config = getConfig()
if (config.optimization) {
config.optimization.minimizer = [new TerserPlugin()]
}
if (stage === 'build-html' || stage === 'develop-html') {
actions.setWebpackConfig({
module: {
rules: [
{
test: /analytics/,
use: loaders.null(),
},
],
},
})
}

actions.setWebpackConfig({
devtool: false,
...(config.optimization ? { optimization: { minimizer: [new TerserPlugin()] } } : {}),
plugins: [new StylelintPlugin({ ...style_lint_options, ...options })],
resolve: {
modules: [path.resolve(__dirname, 'src'), 'node_modules'],
},
...((stage === 'build-html' || stage === 'develop-html') ? { module: { rules: [ { test: /analytics/, use: loaders.null() } ] } } : {}),
})
}
}

0 comments on commit b3bf4a2

Please sign in to comment.