10up-toolkit
Advanced tools
Comparing version 4.3.0 to 4.3.1
# Changelog | ||
## 4.3.1 | ||
### Patch Changes | ||
- 010cea6: Fix processing order whenever Sass is used | ||
- Updated dependencies [010cea6] | ||
- @10up/babel-preset-default@2.0.4 | ||
- @10up/eslint-config@2.4.7 | ||
- @10up/stylelint-config@2.0.2 | ||
## 4.3.0 | ||
@@ -4,0 +14,0 @@ |
@@ -6,2 +6,4 @@ const MiniCSSExtractPlugin = require('mini-css-extract-plugin'); | ||
const getCSSLoaders = ({ options, postcss, sass }) => { | ||
// Note that the order of loaders is important. The loaders are applied from right to left. | ||
// This goes as Sass -> PostCSS -> CSS -> MiniCSSExtractPlugin | ||
return [ | ||
@@ -15,8 +17,2 @@ { | ||
}, | ||
sass && { | ||
loader: require.resolve('sass-loader'), | ||
options: { | ||
sourceMap: options ? options.sourceMap : false, | ||
}, | ||
}, | ||
postcss && { | ||
@@ -34,2 +30,8 @@ loader: require.resolve('postcss-loader'), | ||
}, | ||
sass && { | ||
loader: require.resolve('sass-loader'), | ||
options: { | ||
sourceMap: options ? options.sourceMap : false, | ||
}, | ||
}, | ||
].filter(Boolean); | ||
@@ -36,0 +38,0 @@ }; |
@@ -16,3 +16,3 @@ { | ||
}, | ||
"version": "4.3.0", | ||
"version": "4.3.1", | ||
"bin": { | ||
@@ -74,11 +74,11 @@ "10up-toolkit": "bin/10up-toolkit.js" | ||
"devDependencies": { | ||
"@10up/babel-preset-default": "^2.0.3", | ||
"@10up/eslint-config": "^2.4.6", | ||
"@10up/stylelint-config": "^2.0.1", | ||
"@10up/babel-preset-default": "^2.0.4", | ||
"@10up/eslint-config": "^2.4.7", | ||
"@10up/stylelint-config": "^2.0.2", | ||
"glob": "^7.2.0" | ||
}, | ||
"peerDependencies": { | ||
"@10up/babel-preset-default": "^2.0.3", | ||
"@10up/eslint-config": "^2.4.6", | ||
"@10up/stylelint-config": ">=2.0.1" | ||
"@10up/babel-preset-default": "^2.0.4", | ||
"@10up/eslint-config": "^2.4.7", | ||
"@10up/stylelint-config": ">=2.0.2" | ||
}, | ||
@@ -85,0 +85,0 @@ "description": "Collection of reusable scripts for 10up development.", |
@@ -193,2 +193,19 @@ # 10up-toolkit | ||
### WordPress Block Asset Handling | ||
If your project includes blocks there are quite a few assets that need to get added to the list of entrypoints for Webpack to transpile. This can get quite cumbersome and repetitive. To make this easier toolkit has a special mode where it scans the source path for any `block.json` files and automatically adds any assets that are defined in there via the `script`, `editorScript`, `viewScript`, `style`, `editorStyle` keys with webpack. | ||
It also automatically moves all files including the `block.json` and and PHP files to the `dist/blocks/` folder. | ||
To opt into this mode you need to add the `useBlockAssets` option to your toolkit configuration: | ||
```json | ||
"10up-toolkit": { | ||
"devURL": "https://my-project.test", | ||
"useBlockAssets": true | ||
} | ||
``` | ||
By default the source directory for blocks is `./includes/blocks/`. This can be customized via the `blocksDir` key in the paths config. | ||
### WordPress Editor Styles | ||
@@ -195,0 +212,0 @@ |
111666
1976
848