Open aixaqh opened 5 years ago
const Purgecss = require('purgecss') const fs = require('fs') const path = require('path') const outputDir = path.resolve(__dirname,'dist')
const purgecss = new Purgecss({
content:[ 'office/autoship/*.aspx', 'office/communication-center/*.aspx', 'office/Dashboards/*.aspx', 'office/genealogy/*.aspx', 'office/home/*.aspx', 'office/profile/*.aspx', 'office/reports/*.aspx', 'office/user-resources/*.aspx', 'office/wallet/*.aspx'], css:[ // 'src/**/*.css', 'secure/css/*.css', // 'office/src/css/*.css', // 'office/wallet/src/css/*.css', // 'office/reports/src/css/*.css', // 'office/profile/src/css/*.css', // 'office/home/src/css/*.css', // 'office/genealogy/src/css/*.css', // 'office/Dashboards/src/css/*.css' ], extractors: [ { extractor: class { static extract(content) { return content.match(/[A-z0-9-:\/]+/g) || [] } }, extensions: ['html', 'js'] } ]
}) const result = purgecss.purge()
result.forEach(out => { const filePath = out.file.split('/') fs.writeFileSync('${outputDir}/${filePath[filePath.length - 1]}', out.css, 'utf-8') })
console.log('done');
dont work
Probably an issue with your the way your project is set up. If you can share a repo, someone might be able to help you out debugging it. Better suited for /discuss 👍
/discuss
const Purgecss = require('purgecss') const fs = require('fs') const path = require('path') const outputDir = path.resolve(__dirname,'dist')
const purgecss = new Purgecss({
}) const result = purgecss.purge()
result.forEach(out => { const filePath = out.file.split('/') fs.writeFileSync('${outputDir}/${filePath[filePath.length - 1]}', out.css, 'utf-8') })
console.log('done');
dont work