mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
Generate minified file on build
Useful for checking gzip size and making sure we are still reasonable.
Currently at 19.6kb 🤙🏻
This commit is contained in:
parent
e513a00d62
commit
8e1fcd7262
1
dist/tailwind.min.css
vendored
Normal file
1
dist/tailwind.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -29,6 +29,7 @@
|
||||
"babel-preset-react": "^6.24.1",
|
||||
"babel-preset-stage-2": "^6.24.1",
|
||||
"babel-preset-stage-3": "^6.24.1",
|
||||
"clean-css": "^4.1.9",
|
||||
"jest": "^20.0.4",
|
||||
"rimraf": "^2.6.1"
|
||||
},
|
||||
@ -38,8 +39,8 @@
|
||||
"nodemon": "^1.11.0",
|
||||
"normalize.css": "^7.0.0",
|
||||
"postcss": "^6.0.9",
|
||||
"postcss-import": "^11.0.0",
|
||||
"postcss-functions": "^3.0.0",
|
||||
"postcss-import": "^11.0.0",
|
||||
"stylefmt": "^6.0.0"
|
||||
},
|
||||
"browserslist": [
|
||||
|
||||
12
src/build.js
12
src/build.js
@ -2,6 +2,7 @@ import fs from 'fs'
|
||||
import postcss from 'postcss'
|
||||
import tailwind from '..'
|
||||
import defaultConfig from './defaultConfig'
|
||||
import CleanCSS from 'clean-css'
|
||||
|
||||
console.info('Building Tailwind!')
|
||||
|
||||
@ -10,11 +11,18 @@ fs.readFile('./css/tailwind.css', (err, css) => {
|
||||
.process(css, {
|
||||
from: './css/tailwind.css',
|
||||
to: './dist/tailwind.css',
|
||||
map: {inline: false},
|
||||
map: { inline: false },
|
||||
})
|
||||
.then(result => {
|
||||
fs.writeFileSync('./dist/tailwind.css', result.css)
|
||||
if (result.map) fs.writeFileSync('./dist/tailwind.css.map', result.map)
|
||||
if (result.map) {
|
||||
fs.writeFileSync('./dist/tailwind.css.map', result.map)
|
||||
}
|
||||
return result
|
||||
})
|
||||
.then(result => {
|
||||
const minified = new CleanCSS().minify(result.css)
|
||||
fs.writeFileSync('./dist/tailwind.min.css', minified.styles)
|
||||
})
|
||||
.catch(error => console.log(error))
|
||||
})
|
||||
|
||||
31
yarn.lock
31
yarn.lock
@ -1056,6 +1056,12 @@ circular-json@^0.3.1:
|
||||
version "0.3.3"
|
||||
resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66"
|
||||
|
||||
clean-css@^4.1.9, clean-css@^4.x:
|
||||
version "4.1.9"
|
||||
resolved "https://registry.yarnpkg.com/clean-css/-/clean-css-4.1.9.tgz#35cee8ae7687a49b98034f70de00c4edd3826301"
|
||||
dependencies:
|
||||
source-map "0.5.x"
|
||||
|
||||
cli-boxes@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-1.0.0.tgz#4fa917c3e59c94a004cd61f8ee509da651687143"
|
||||
@ -3065,6 +3071,13 @@ plur@^2.0.0, plur@^2.1.2:
|
||||
dependencies:
|
||||
irregular-plurals "^1.0.0"
|
||||
|
||||
postcss-clean@^1.1.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/postcss-clean/-/postcss-clean-1.1.0.tgz#c2d61d5d8caf19a585adba16897726c2674c4207"
|
||||
dependencies:
|
||||
clean-css "^4.x"
|
||||
postcss "^6.x"
|
||||
|
||||
postcss-functions@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/postcss-functions/-/postcss-functions-3.0.0.tgz#0e94d01444700a481de20de4d55fb2640564250e"
|
||||
@ -3163,6 +3176,14 @@ postcss@^6.0.1, postcss@^6.0.3, postcss@^6.0.9:
|
||||
source-map "^0.5.7"
|
||||
supports-color "^4.4.0"
|
||||
|
||||
postcss@^6.x:
|
||||
version "6.0.13"
|
||||
resolved "https://registry.yarnpkg.com/postcss/-/postcss-6.0.13.tgz#b9ecab4ee00c89db3ec931145bd9590bbf3f125f"
|
||||
dependencies:
|
||||
chalk "^2.1.0"
|
||||
source-map "^0.6.1"
|
||||
supports-color "^4.4.0"
|
||||
|
||||
prelude-ls@~1.1.2:
|
||||
version "1.1.2"
|
||||
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
|
||||
@ -3527,15 +3548,19 @@ source-map-support@^0.4.15:
|
||||
dependencies:
|
||||
source-map "^0.5.6"
|
||||
|
||||
source-map@0.5.x, source-map@^0.5.3, source-map@^0.5.6, source-map@^0.5.7, source-map@~0.5.1, source-map@~0.5.6:
|
||||
version "0.5.7"
|
||||
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc"
|
||||
|
||||
source-map@^0.4.2, source-map@^0.4.4:
|
||||
version "0.4.4"
|
||||
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b"
|
||||
dependencies:
|
||||
amdefine ">=0.0.4"
|
||||
|
||||
source-map@^0.5.3, source-map@^0.5.6, source-map@^0.5.7, source-map@~0.5.1, source-map@~0.5.6:
|
||||
version "0.5.7"
|
||||
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc"
|
||||
source-map@^0.6.1:
|
||||
version "0.6.1"
|
||||
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
|
||||
|
||||
spdx-correct@~1.0.0:
|
||||
version "1.0.2"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user