Created
January 25, 2021 07:15
-
-
Save selvagsz/99ccdce4cecd47f26e99901af196d3b5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
'use strict'; | |
const EmberApp = require('ember-cli/lib/broccoli/ember-app'); | |
const isProduction = EmberApp.env() === 'production'; | |
const purgeCSS = { | |
module: require('@fullhuman/postcss-purgecss'), | |
options: { | |
content: [ | |
// add extra paths here for components/controllers which include tailwind classes | |
'./app/index.html', | |
'./app/templates/**/*.hbs', | |
'./app/components/**/*.js', | |
'./app/components/**/*.hbs', | |
], | |
defaultExtractor: (content) => { | |
return content.match(/[A-Za-z0-9-_:/]+/g) || []; | |
}, | |
}, | |
}; | |
module.exports = function (defaults) { | |
const project = defaults.project; | |
let app = new EmberApp(defaults, { | |
postcssOptions: { | |
compile: { | |
extension: 'scss', | |
enabled: true, | |
parser: require('postcss-scss'), | |
plugins: [ | |
{ | |
module: require('@csstools/postcss-sass'), | |
options: { | |
includePaths: ['node_modules'], | |
}, | |
}, | |
{ | |
module: require('postcss-import'), | |
options: { | |
path: ['node_modules'], | |
}, | |
}, | |
require('tailwindcss')('./config/tailwind.js'), | |
// ...(isProduction ? [purgeCSS] : []), | |
], | |
}, | |
}, | |
}); | |
return app.toTree(); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment