Created
July 10, 2019 17:35
-
-
Save tylerzey/1e57cc094065b210bb43c2dde7321e1c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path'); | |
const fs = require('fs'); | |
const glob = require('glob-all'); | |
const appDirectory = fs.realpathSync(process.cwd()); | |
const resolveApp = relativePath => path.resolve(appDirectory, relativePath); | |
const PurgecssPlugin = require('purgecss-webpack-plugin'); | |
module.exports = { | |
webpack: { | |
plugins: [ | |
new PurgecssPlugin({ | |
paths: [resolveApp('public/index.html'), ...glob.sync(`${resolveApp('src')}/**/**/*`, { nodir: true })], | |
}), | |
], | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment