0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

🎨 Myth => PostCSS (#537)

This commit is contained in:
Austin Burdine 2017-02-17 13:46:41 -06:00 committed by John O'Nolan
parent a39b553f44
commit e91b231452
3 changed files with 632 additions and 313 deletions

View file

@ -8,7 +8,6 @@ var EmberApp = require('ember-cli/lib/broccoli/ember-app'),
cleanCSS = require('broccoli-clean-css'), cleanCSS = require('broccoli-clean-css'),
environment = EmberApp.env(), environment = EmberApp.env(),
isProduction = environment === 'production', isProduction = environment === 'production',
mythCompress = isProduction || environment === 'test',
disabled = {enabled: false}, disabled = {enabled: false},
assetLocation, codemirrorAssets; assetLocation, codemirrorAssets;
@ -62,29 +61,53 @@ codemirrorAssets = function () {
}; };
}; };
function postcssPlugins() {
var plugins = [{
module: require('postcss-easy-import')
}, {
module: require('postcss-custom-properties')
}, {
module: require('postcss-color-function')
}, {
module: require('autoprefixer'),
options: {
browsers: ['last 2 versions']
}
}];
if (isProduction) {
plugins.push({
module: require('cssnano')
});
}
return plugins;
}
module.exports = function (defaults) { module.exports = function (defaults) {
var app = new EmberApp(defaults, { var app = new EmberApp(defaults, {
"ember-cli-babel": { 'ember-cli-babel': {
optional: ['es6.spec.symbols'], optional: ['es6.spec.symbols'],
includePolyfill: true includePolyfill: true
}, },
outputPaths: { outputPaths: {
app: { app: {
js: assetLocation('ghost.js') js: assetLocation('ghost.js'),
css: {
app: assetLocation('ghost.css'),
'app-dark': assetLocation('ghost-dark.css')
}
}, },
vendor: { vendor: {
js: assetLocation('vendor.js'), js: assetLocation('vendor.js'),
css: assetLocation('vendor.css') css: assetLocation('vendor.css')
} }
}, },
mythOptions: { postcssOptions: {
source: './app/styles/app.css', compile: {
inputFile: 'app.css', enabled: true,
browsers: 'last 2 versions', plugins: postcssPlugins()
// @TODO: enable sourcemaps for development without including them in the release }
sourcemap: false,
compress: mythCompress,
outputFile: isProduction ? 'ghost.min.css' : 'ghost.css'
}, },
fingerprint: disabled, fingerprint: disabled,
nodeAssets: { nodeAssets: {
@ -136,8 +159,6 @@ module.exports = function (defaults) {
app.import('bower_components/google-caja/html-css-sanitizer-bundle.js'); app.import('bower_components/google-caja/html-css-sanitizer-bundle.js');
app.import('bower_components/jqueryui-touch-punch/jquery.ui.touch-punch.js'); app.import('bower_components/jqueryui-touch-punch/jquery.ui.touch-punch.js');
if (app.env === 'test') { if (app.env === 'test') {
app.import(app.bowerDirectory + '/jquery.simulate.drag-sortable/jquery.simulate.drag-sortable.js', {type: 'test'}); app.import(app.bowerDirectory + '/jquery.simulate.drag-sortable/jquery.simulate.drag-sortable.js', {type: 'test'});
} }

View file

@ -26,6 +26,7 @@
"node": "~0.12.0 || ^4.2.0" "node": "~0.12.0 || ^4.2.0"
}, },
"devDependencies": { "devDependencies": {
"autoprefixer": "6.7.3",
"blueimp-md5": "2.6.0", "blueimp-md5": "2.6.0",
"bower": "1.8.0", "bower": "1.8.0",
"broccoli-asset-rev": "2.5.0", "broccoli-asset-rev": "2.5.0",
@ -37,6 +38,7 @@
"codemirror": "5.23.0", "codemirror": "5.23.0",
"coveralls": "2.11.16", "coveralls": "2.11.16",
"csscomb": "3.1.8", "csscomb": "3.1.8",
"cssnano": "3.10.0",
"ember-ajax": "2.5.4", "ember-ajax": "2.5.4",
"ember-cli": "2.11.0", "ember-cli": "2.11.0",
"ember-cli-active-link-wrapper": "0.3.2", "ember-cli-active-link-wrapper": "0.3.2",
@ -54,6 +56,7 @@
"ember-cli-mirage": "0.2.5", "ember-cli-mirage": "0.2.5",
"ember-cli-mocha": "0.13.2", "ember-cli-mocha": "0.13.2",
"ember-cli-node-assets": "0.1.6", "ember-cli-node-assets": "0.1.6",
"ember-cli-postcss": "3.1.1",
"ember-cli-pretender": "1.0.1", "ember-cli-pretender": "1.0.1",
"ember-cli-selectize": "0.5.12", "ember-cli-selectize": "0.5.12",
"ember-cli-shims": "1.0.2", "ember-cli-shims": "1.0.2",
@ -69,7 +72,6 @@
"ember-light-table": "1.8.2", "ember-light-table": "1.8.2",
"ember-load": "0.0.11", "ember-load": "0.0.11",
"ember-load-initializers": "0.6.3", "ember-load-initializers": "0.6.3",
"ember-myth": "0.1.1",
"ember-one-way-controls": "2.0.0", "ember-one-way-controls": "2.0.0",
"ember-power-select": "1.4.3", "ember-power-select": "1.4.3",
"ember-resolver": "2.1.1", "ember-resolver": "2.1.1",
@ -97,6 +99,9 @@
"moment": "2.17.1", "moment": "2.17.1",
"moment-timezone": "0.5.11", "moment-timezone": "0.5.11",
"password-generator": "2.1.0", "password-generator": "2.1.0",
"postcss-color-function": "3.0.0",
"postcss-custom-properties": "5.0.2",
"postcss-easy-import": "2.0.0",
"top-gh-contribs": "2.0.4", "top-gh-contribs": "2.0.4",
"torii": "0.8.1", "torii": "0.8.1",
"walk-sync": "0.3.1" "walk-sync": "0.3.1"

File diff suppressed because it is too large Load diff