mirror of
https://gitlab.com/timvisee/send.git
synced 2024-11-08 20:22:45 +01:00
41 lines
770 B
JavaScript
41 lines
770 B
JavaScript
class TailwindExtractor {
|
|
static extract(content) {
|
|
return content.match(/[A-Za-z0-9-_:/]+/g) || [];
|
|
}
|
|
}
|
|
|
|
const options = {
|
|
plugins: [
|
|
require('tailwindcss')('./tailwind.config.js'),
|
|
require('postcss-preset-env')
|
|
]
|
|
};
|
|
|
|
if (process.env.NODE_ENV === 'development') {
|
|
options.map = { inline: true };
|
|
} else {
|
|
options.plugins.push(
|
|
require('@fullhuman/postcss-purgecss')({
|
|
content: [
|
|
'./app/*.js',
|
|
'./app/ui/*.js',
|
|
'./android/*.js',
|
|
'./android/pages/*.js'
|
|
],
|
|
extractors: [
|
|
{
|
|
extractor: TailwindExtractor,
|
|
extensions: ['js']
|
|
}
|
|
]
|
|
})
|
|
);
|
|
options.plugins.push(
|
|
require('cssnano')({
|
|
preset: 'default'
|
|
})
|
|
);
|
|
}
|
|
|
|
module.exports = options;
|