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'; @tailwind preflight;
@import 'tailwindcss/components'; @tailwind components;
@import 'tailwindcss/utilities'; @tailwind utilities;
a { a {
color: inherit; color: inherit;

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

View file

@ -1,10 +1,25 @@
const options = { class TailwindExtractor {
plugins: { static extract(content) {
'postcss-import': {}, return content.match(/[A-Za-z0-9-_:/]+/g) || [];
tailwindcss: {},
'postcss-cssnext': {},
'css-mqpacker': {}
} }
}
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') { if (process.env.NODE_ENV === 'development') {