Skip to content

Instantly share code, notes, and snippets.

@selvagsz
Created January 25, 2021 07:15
Show Gist options
  • Save selvagsz/99ccdce4cecd47f26e99901af196d3b5 to your computer and use it in GitHub Desktop.
Save selvagsz/99ccdce4cecd47f26e99901af196d3b5 to your computer and use it in GitHub Desktop.
'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