Skip to content

Instantly share code, notes, and snippets.

@c10r
c10r / webpack.config.js
Created May 27, 2020 20:27
Enable purgeCSS in webpack
const purgecss = require('@fullhuman/postcss-purgecss')({
// Specify the paths to all of the template files in your project
content: [
'./src/**/*.html',
'./src/**/*.js',
],
// Used to extract class names from your templates
defaultExtractor: content => {
// Capture as liberally as possible
const broadMatches = content.match(/[^<>"'`\s]*[^<>"'`\s:]/g) || []
purge: {
enabled: true, // This will *always* minify, even on dev builds
content: [
'./src/**/*.html',
'./src/**/*.js',
],
},
try {
const setupResult = await Auth.signUp({
username: email,
password,
attributes: {
email,
},
})
// This will fail
const code = await Auth.setupTOTP(setupResult.user)