mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
* WIP * WIP * Finish combining JIT and AOT plugins Still lots of clean up that can be done in some of the more complex ones, but at least it's one file per plugin now. * Remove unused import * Fix AOT generation bugs * Move corePlugins/index.js to corePlugins.js * Convert JIT files to ESM * Move tests * Reorder core plugins to match JIT order * Update AOT apply tests * Unify utils * Combine plugin lists to one single source of truth * Finish resolving merge conflicts, fix tests Co-authored-by: Adam Wathan <adam.wathan@gmail.com>
69 lines
1.6 KiB
JavaScript
69 lines
1.6 KiB
JavaScript
import fs from 'fs'
|
|
import postcss from 'postcss'
|
|
import tailwind from '..'
|
|
|
|
function build({ from, to, config }) {
|
|
return new Promise((resolve, reject) => {
|
|
console.log(`Processing ./${from}...`)
|
|
|
|
fs.readFile(`./${from}`, (err, css) => {
|
|
if (err) throw err
|
|
|
|
return postcss([tailwind(config)])
|
|
.process(css, {
|
|
from: undefined,
|
|
})
|
|
.then((result) => {
|
|
fs.writeFileSync(`./${to}`, result.css)
|
|
return result
|
|
})
|
|
.then(resolve)
|
|
.catch((error) => {
|
|
console.log(error)
|
|
reject()
|
|
})
|
|
})
|
|
})
|
|
}
|
|
|
|
console.info('\nRebuilding fixtures...\n')
|
|
|
|
Promise.all([
|
|
build({
|
|
from: 'tests/fixtures/tailwind-input.css',
|
|
to: 'tests/fixtures/tailwind-output.css',
|
|
config: {},
|
|
}),
|
|
build({
|
|
from: 'tests/fixtures/tailwind-input.css',
|
|
to: 'tests/fixtures/tailwind-output-important.css',
|
|
config: { important: true },
|
|
}),
|
|
build({
|
|
from: 'tests/fixtures/tailwind-input.css',
|
|
to: 'tests/fixtures/tailwind-output-no-color-opacity.css',
|
|
config: {
|
|
corePlugins: {
|
|
textOpacity: false,
|
|
backgroundOpacity: false,
|
|
borderOpacity: false,
|
|
placeholderOpacity: false,
|
|
divideOpacity: false,
|
|
},
|
|
},
|
|
}),
|
|
build({
|
|
from: 'tests/fixtures/tailwind-input.css',
|
|
to: 'tests/fixtures/tailwind-output-flagged.css',
|
|
config: {
|
|
future: 'all',
|
|
experimental: 'all',
|
|
},
|
|
}),
|
|
]).then(() => {
|
|
console.log('\nFinished rebuilding fixtures.')
|
|
console.log(
|
|
'\nPlease triple check that the fixture output matches what you expect before committing this change.'
|
|
)
|
|
})
|