Skip to content

Commit

Permalink
feat(config): add self to purge
Browse files Browse the repository at this point in the history
  • Loading branch information
nolimits4web committed Aug 26, 2021
1 parent ad65609 commit cec552b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const path = require('path');
const configExtend = require('./config/config-extend.js');
const extendTheme = require('./config/extend-theme.js');
const extendVariants = require('./config/extend-variants.js');
Expand All @@ -13,8 +14,10 @@ const pluginDarkMode = require('./config/plugin-dark-mode.js');
const pluginTranslucent = require('./config/plugin-translucent.js');
const pluginRange = require('./config/plugin-range.js');

const purge = `${path.resolve(__dirname)}/**/*.{js,ts,jsx,tsx,vue,svelte}`;

const config = (userConfig = {}) => {
return configExtend(
const newConfig = configExtend(
{},
{
theme: {
Expand All @@ -38,5 +41,9 @@ const config = (userConfig = {}) => {
},
userConfig
);
if (!newConfig.purge) newConfig.purge = [purge];
else newConfig.purge = [...newConfig.purge, purge];

return newConfig;
};
module.exports = config;

0 comments on commit cec552b

Please sign in to comment.