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

test #6528

Closed
wants to merge 1 commit into from
Closed

test #6528

Changes from all commits
Commits
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
29 changes: 13 additions & 16 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -397,27 +397,24 @@ const style_lint_options = {
lintDirtyModulesOnly: true,
}

exports.onCreateWebpackConfig = ({ stage, actions, loaders, getConfig }, { ...options }) => {
exports.onCreateWebpackConfig = ({ 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(),
},
],
},
})
}
const isProduction = config.mode === 'production'

actions.setWebpackConfig({
devtool: false,
mode: isProduction ? 'production' : 'development',
plugins: [new StylelintPlugin({ ...style_lint_options, ...options })],
resolve: {
modules: [path.resolve(__dirname, 'src'), 'node_modules'],
},
module: {
rules: [
{
test: /analytics/,
use: loaders.null(),
},
],
},
})
}
Loading