mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
* Update lockfile * Tweak formatting * Refactor content path parsing * Allow resolving content paths relative to the config file * Include resolved symlinks as additional content paths * Update changelog * Work on suite of tests for content resolution * reformat integration test list * Move content resolution tests to integration * Update future and experimental types
54 lines
1.1 KiB
JavaScript
54 lines
1.1 KiB
JavaScript
// @ts-config
|
|
|
|
let fs = require('fs')
|
|
let path = require('path')
|
|
|
|
module.exports.writeConfigs = async function writeConfigs({
|
|
both = {},
|
|
inRoot = {},
|
|
inDir = {},
|
|
} = {}) {
|
|
let configs = [
|
|
{
|
|
path: '../tailwind.config.js',
|
|
config: {
|
|
...both,
|
|
...inRoot,
|
|
content: {
|
|
files: [],
|
|
...both.content,
|
|
...inRoot.content,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
path: '../src/tailwind.config.js',
|
|
config: {
|
|
...both,
|
|
...inDir,
|
|
content: {
|
|
files: [],
|
|
...both.content,
|
|
...inDir.content,
|
|
},
|
|
},
|
|
},
|
|
]
|
|
|
|
let defaultConfig = {
|
|
corePlugins: { preflight: false },
|
|
}
|
|
|
|
for (const config of configs) {
|
|
await fs.promises.writeFile(
|
|
path.resolve(__dirname, config.path),
|
|
`module.exports = ${JSON.stringify({ ...defaultConfig, ...config.config })};`
|
|
)
|
|
}
|
|
}
|
|
|
|
module.exports.destroyConfigs = async function destroyConfigs() {
|
|
await fs.promises.unlink(path.resolve(__dirname, '../tailwind.config.js'))
|
|
await fs.promises.unlink(path.resolve(__dirname, '../src/tailwind.config.js'))
|
|
}
|