24
1
Fork 0

added purgecss and cssnano

This commit is contained in:
Danny Coates 2018-10-25 16:49:22 -07:00
parent 211404237a
commit d881755814
No known key found for this signature in database
GPG Key ID: 4C442633C62E00CB
4 changed files with 2190 additions and 695 deletions

View File

@ -1,6 +1,6 @@
@import 'tailwindcss/preflight';
@import 'tailwindcss/components';
@import 'tailwindcss/utilities';
@tailwind preflight;
@tailwind components;
@tailwind utilities;
a {
color: inherit;

2848
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -64,6 +64,7 @@
"@babel/polyfill": "^7.0.0",
"@babel/preset-env": "^7.1.0",
"@dannycoates/webpack-dev-server": "^3.1.4",
"@fullhuman/postcss-purgecss": "^1.1.0",
"@mattiasbuelens/web-streams-polyfill": "0.1.0",
"asmcrypto.js": "^2.3.2",
"babel-loader": "^8.0.4",
@ -76,6 +77,7 @@
"cross-env": "^5.2.0",
"css-loader": "^1.0.0",
"css-mqpacker": "^7.0.0",
"cssnano": "^4.1.7",
"eslint": "^5.6.1",
"eslint-plugin-mocha": "^5.2.0",
"eslint-plugin-node": "^7.0.1",
@ -97,8 +99,6 @@
"nanotiming": "^7.3.1",
"npm-run-all": "^4.1.3",
"nyc": "^13.0.1",
"postcss-cssnext": "^3.1.0",
"postcss-import": "^12.0.0",
"postcss-loader": "^3.0.0",
"prettier": "^1.14.3",
"proxyquire": "^2.1.0",

View File

@ -1,10 +1,25 @@
const options = {
plugins: {
'postcss-import': {},
tailwindcss: {},
'postcss-cssnext': {},
'css-mqpacker': {}
class TailwindExtractor {
static extract(content) {
return content.match(/[A-Za-z0-9-_:/]+/g) || [];
}
}
const options = {
plugins: [
require('tailwindcss')('./tailwind.js'),
require('@fullhuman/postcss-purgecss')({
content: ['./app/*.js', './app/ui/*.js'],
extractors: [
{
extractor: TailwindExtractor,
extensions: ['js']
}
]
}),
require('cssnano')({
preset: 'default'
})
]
};
if (process.env.NODE_ENV === 'development') {