-
-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
manually running postcss and adding it to vendor
- Loading branch information
Showing
8 changed files
with
3,932 additions
and
6,215 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,25 +1,35 @@ | ||
'use strict'; | ||
|
||
const CssImport = require('postcss-import'); | ||
const PresetEnv = require('postcss-preset-env'); | ||
|
||
var broccoliPostCSS = require('broccoli-postcss') | ||
const mergeTrees = require('broccoli-merge-trees'); | ||
var get = require('lodash.get'); | ||
const { join } = require('path'); | ||
|
||
module.exports = { | ||
name: require('./package').name, | ||
|
||
options: { | ||
postcssOptions: { | ||
compile: { | ||
enabled: true, | ||
plugins: [ | ||
{ | ||
module: PresetEnv, | ||
options: { stage: 3 }, | ||
features: { | ||
'nesting-rules': true | ||
} | ||
} | ||
] | ||
} | ||
} | ||
treeForAddon() { | ||
var tree = this._super(...arguments); | ||
|
||
// I don't know exactly why targets is private so I am using `get()` to make | ||
// sure that it isn't missing | ||
let overrideBrowserslist = get(this, 'app.project._targets.browsers'); | ||
|
||
let newFile = broccoliPostCSS(join(__dirname, 'prebuilt-styles'), { | ||
plugins: [ | ||
CssImport({ | ||
path: join(__dirname, 'prebuilt-styles'), | ||
addModulesDirectories: [__dirname] | ||
}), | ||
PresetEnv({ | ||
stage: 3, | ||
features: { 'nesting-rules': true }, | ||
overrideBrowserslist, | ||
}) | ||
]}); | ||
|
||
return mergeTrees([tree, newFile]); | ||
}, | ||
}; |
Oops, something went wrong.