From b3bf4a2b78ddea24f311d625650fcbb87e639ab5 Mon Sep 17 00:00:00 2001 From: eduardhrachou Date: Tue, 16 Jan 2024 15:31:33 +0300 Subject: [PATCH] removed source-maps --- gatsby-node.js | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/gatsby-node.js b/gatsby-node.js index 75a5d4fbaae..18913b51301 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -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() } ] } } : {}), }) -} +} \ No newline at end of file