Skip to content

Commit f15bc03

Browse files
authored
Merge pull request #164 from ZoltanVeres/purgecss-develop-improvements
Purgecss develop improvements
2 parents c5ddee0 + 13d2fa0 commit f15bc03

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

gatsby-config.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,13 @@ module.exports = {
6464
modulePath: `${__dirname}/src/cms/cms.js`,
6565
},
6666
},
67-
'gatsby-plugin-purgecss', // must be after other CSS plugins
67+
{
68+
resolve:'gatsby-plugin-purgecss', // purges all unused/unreferenced css rules
69+
options: {
70+
develop: true, // Activates purging in npm run develop
71+
purgeOnly: ['/all.sass'], // applies purging only on the bulma css file
72+
},
73+
}, // must be after other CSS plugins
6874
'gatsby-plugin-netlify', // make sure to keep it last in the array
6975
],
7076
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"gatsby-image": "^2.0.23",
1010
"gatsby-plugin-netlify": "^2.0.6",
1111
"gatsby-plugin-netlify-cms": "^3.0.9",
12-
"gatsby-plugin-purgecss": "^3.0.0",
12+
"gatsby-plugin-purgecss": "^3.1.0",
1313
"gatsby-plugin-react-helmet": "^3.0.4",
1414
"gatsby-plugin-sass": "^2.0.7",
1515
"gatsby-plugin-sharp": "^2.0.15",

yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5076,9 +5076,9 @@ gatsby-plugin-page-creator@^2.0.5:
50765076
parse-filepath "^1.0.1"
50775077
slash "^1.0.0"
50785078

5079-
gatsby-plugin-purgecss@^3.0.0:
5080-
version "3.0.0"
5081-
resolved "https://registry.yarnpkg.com/gatsby-plugin-purgecss/-/gatsby-plugin-purgecss-3.0.0.tgz#3d9ab151f6b8098053e272a461f2d3680c89a291"
5079+
gatsby-plugin-purgecss@^3.1.0:
5080+
version "3.1.0"
5081+
resolved "https://registry.yarnpkg.com/gatsby-plugin-purgecss/-/gatsby-plugin-purgecss-3.1.0.tgz#ecaf5266317ef3deba94478f341f2855f58a3a74"
50825082
dependencies:
50835083
fs-extra "^7.0.0"
50845084
loader-utils "^1.1.0"

0 commit comments

Comments
 (0)