Merge branch 'master' into normalize-quotes

This commit is contained in:
Ben Word
2018-11-16 11:34:28 -07:00
committed by GitHub
20 changed files with 3001 additions and 2100 deletions

View File

@@ -44,7 +44,7 @@ if (process.env.NODE_ENV === undefined) {
* If your publicPath differs between environments, but you know it at compile time,
* then set SAGE_DIST_PATH as an environment variable before compiling.
* Example:
* SAGE_DIST_PATH=/wp-content/themes/sage/dist yarn build:production
* SAGE_DIST_PATH=/wp-content/themes/sage/dist/ yarn build:production
*/
if (process.env.SAGE_DIST_PATH) {
module.exports.publicPath = process.env.SAGE_DIST_PATH;

View File

@@ -8,8 +8,8 @@ module.exports = ({ file, options }) => {
return {
parser: options.enabled.optimize ? 'postcss-safe-parser' : undefined,
plugins: {
cssnano: options.enabled.optimize ? cssnanoConfig : false,
autoprefixer: true,
cssnano: options.enabled.optimize ? cssnanoConfig : false,
},
};
};

View File

@@ -8,6 +8,7 @@ const StyleLintPlugin = require('stylelint-webpack-plugin');
const CopyGlobsPlugin = require('copy-globs-webpack-plugin');
const FriendlyErrorsWebpackPlugin = require('friendly-errors-webpack-plugin');
const desire = require('./util/desire');
const config = require('./config');
const assetsFilenames = (config.enabled.cacheBusting) ? config.cacheBusting : '[name]';
@@ -89,7 +90,12 @@ let webpackConfig = {
},
},
{ loader: 'resolve-url', options: { sourceMap: config.enabled.sourceMaps } },
{ loader: 'sass', options: { sourceMap: config.enabled.sourceMaps } },
{
loader: 'sass', options: {
sourceMap: config.enabled.sourceMaps,
sourceComments: true,
},
},
],
}),
},
@@ -208,4 +214,15 @@ if (config.enabled.watcher) {
webpackConfig = merge(webpackConfig, require('./webpack.config.watch'));
}
module.exports = webpackConfig;
/**
* During installation via sage-installer (i.e. composer create-project) some
* presets may generate a preset specific config (webpack.config.preset.js) to
* override some of the default options set here. We use webpack-merge to merge
* them in. If you need to modify Sage's default webpack config, we recommend
* that you modify this file directly, instead of creating your own preset
* file, as there are limitations to using webpack-merge which can hinder your
* ability to change certain options.
*/
module.exports = merge.smartStrategy({
'module.loaders': 'replace',
})(webpackConfig, desire(`${__dirname}/webpack.config.preset`));

View File

@@ -2,6 +2,7 @@
const { default: ImageminPlugin } = require('imagemin-webpack-plugin');
const imageminMozjpeg = require('imagemin-mozjpeg');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const config = require('./config');
@@ -21,5 +22,14 @@ module.exports = {
plugins: [imageminMozjpeg({ quality: 75 })],
disable: (config.enabled.watcher),
}),
new UglifyJsPlugin({
uglifyOptions: {
ecma: 5,
compress: {
warnings: true,
drop_console: true,
},
},
}),
],
};

View File

@@ -4,3 +4,7 @@
$theme-colors: (
primary: #525ddc
);
/** Bootstrap navbar fix (https://git.io/fADqW) */
$navbar-dark-toggler-icon-bg: none;
$navbar-light-toggler-icon-bg: none;

View File

@@ -2,7 +2,7 @@
Theme Name: Sage Starter Theme
Theme URI: https://roots.io/sage/
Description: Sage is a WordPress starter theme.
Version: 9.0.1
Version: 9.0.5
Author: Roots
Author URI: https://roots.io/
Text Domain: sage

View File

@@ -1,5 +1,5 @@
<!doctype html>
<html @php language_attributes() @endphp>
<html {!! get_language_attributes() !!}>
@include('partials.head')
<body @php body_class() @endphp>
@php do_action('get_header') @endphp