Skip to content

Commit

Permalink
fix(css): remove purge css
Browse files Browse the repository at this point in the history
  • Loading branch information
shadow81627 committed Dec 17, 2019
1 parent d4bf1ad commit d04dd62
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 37 deletions.
41 changes: 7 additions & 34 deletions nuxt.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
const path = require('path');
const PurgecssPlugin = require('purgecss-webpack-plugin');
const glob = require('glob-all');

const purgecss = require('@fullhuman/postcss-purgecss');
const pkg = require('./package');

module.exports = {
Expand Down Expand Up @@ -134,6 +129,7 @@ module.exports = {
'nuxt-fontawesome',
'nuxt-i18n',
'nuxt-webfontloader',
// 'nuxt-purgecss',
[
'storyblok-nuxt',
{
Expand Down Expand Up @@ -202,6 +198,11 @@ module.exports = {
},
},

purgeCSS: {
// your settings here
mode: 'postcss',
},

// storyblok: {},

vuetify: {
Expand Down Expand Up @@ -233,7 +234,7 @@ module.exports = {
** Build configuration
*/
build: {
extractCSS: true,
// extractCSS: true,
/*
** You can extend webpack config here
*/
Expand All @@ -247,34 +248,6 @@ module.exports = {
exclude: /(node_modules)/,
});
}

if (!ctx.isDev) {
// Remove unused CSS using PurgeCSS. See https://github.com/FullHuman/purgecss
// for more information about PurgeCSS.
config.plugins.push(
new PurgecssPlugin({
paths: glob.sync([
path.join(__dirname, './pages/**/*.vue'),
path.join(__dirname, './layouts/**/*.vue'),
path.join(__dirname, './components/**/*.vue'),
]),
whitelist: ['html', 'body'],
}),
);
}
},
},

postcss: {
plugins: [
purgecss({
content: [
'./pages/**/*.vue',
'./layouts/**/*.vue',
'./components/**/*.vue',
],
whitelist: ['html', 'body'],
}),
],
},
};
45 changes: 45 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
},
"devDependencies": {
"@bazzite/nuxt-optimized-images": "0.2.2",
"@fullhuman/postcss-purgecss": "1.3.0",
"@lhci/cli": "0.3.7",
"@mdi/js": "4.7.95",
"@nuxtjs/eslint-config": "2.0.0",
Expand All @@ -70,7 +69,6 @@
"eslint-config-prettier": "6.7.0",
"eslint-plugin-nuxt": "0.5.0",
"eslint-plugin-prettier": "3.1.2",
"glob-all": "3.1.0",
"husky": "3.1.0",
"imagemin-gifsicle": "6.0.1",
"imagemin-mozjpeg": "8.0.0",
Expand All @@ -80,8 +78,8 @@
"lint-staged": "9.5.0",
"lqip-loader": "2.2.0",
"nodemon": "2.0.2",
"nuxt-purgecss": "^0.2.1",
"prettier": "1.19.1",
"purgecss-webpack-plugin": "1.6.0",
"require-extension-hooks": "0.3.3",
"require-extension-hooks-babel": "1.0.0",
"require-extension-hooks-vue": "3.0.0",
Expand Down

1 comment on commit d04dd62

@vercel
Copy link

@vercel vercel bot commented on d04dd62 Dec 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.