-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
step 2: remove the post-css process entirely to ease migration to v2 …
…addon
- Loading branch information
1 parent
19e6a63
commit 6270e91
Showing
4 changed files
with
4,938 additions
and
2,335 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,5 @@ | ||
'use strict'; | ||
|
||
const funnel = require('broccoli-funnel'); | ||
const mergeTrees = require('broccoli-merge-trees'); | ||
const BroccoliPostCSS = require('broccoli-postcss'); | ||
const postcssPresetEnv = require('postcss-preset-env'); | ||
|
||
const pkg = require('./package.json'); | ||
|
||
module.exports = { | ||
name: require('./package').name, | ||
|
||
treeForAddon() { | ||
const tree = this._super(...arguments); | ||
const app = this._findHost(); | ||
const options = typeof app.options === 'object' ? app.options : {}; | ||
const addonConfig = options[pkg.name] || {}; | ||
|
||
const addonWithoutStyles = funnel(tree, { | ||
exclude: ['**/*.css'], | ||
}); | ||
|
||
if (addonConfig.excludeCSS === true) { | ||
return addonWithoutStyles; | ||
} | ||
|
||
const addonStyles = funnel(tree, { | ||
include: ['**/*.css'], | ||
}); | ||
|
||
const processedStyles = new BroccoliPostCSS(addonStyles, { | ||
plugins: [ | ||
{ | ||
module: postcssPresetEnv, | ||
options: { | ||
stage: 3, | ||
overrideBrowserslist: app.project._targets.browsers, | ||
}, | ||
}, | ||
], | ||
}); | ||
|
||
return mergeTrees([addonWithoutStyles, processedStyles]); | ||
}, | ||
}; |
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
Oops, something went wrong.