Skip to content

Instantly share code, notes, and snippets.

@tylerzey
Created July 10, 2019 17:35
Show Gist options
  • Save tylerzey/1e57cc094065b210bb43c2dde7321e1c to your computer and use it in GitHub Desktop.
Save tylerzey/1e57cc094065b210bb43c2dde7321e1c to your computer and use it in GitHub Desktop.
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