Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: dilanx/craco
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v6.1.2
Choose a base ref
...
head repository: dilanx/craco
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v6.2.0
Choose a head ref
  • 7 commits
  • 6 files changed
  • 5 contributors

Commits on Mar 20, 2021

  1. Copy the full SHA
    e4229b5 View commit details

Commits on Mar 31, 2021

  1. Copy the full SHA
    df856fc View commit details

Commits on May 23, 2021

  1. Copy the full SHA
    9191781 View commit details

Commits on May 27, 2021

  1. Add missing import

    ilovecommits authored May 27, 2021
    Copy the full SHA
    d50cb18 View commit details
  2. Merge pull request #297 from ilovecommits/patch-1

    Add missing import
    patricklafrance authored May 27, 2021
    Copy the full SHA
    10eed8d View commit details

Commits on Jul 4, 2021

  1. Merge pull request #267 from techhead/master

    Allow to extend plugins by array or function
    patricklafrance authored Jul 4, 2021
    Copy the full SHA
    6fe8a3b View commit details
  2. v6.2.0

    patricklafrance committed Jul 4, 2021
    Copy the full SHA
    6909f73 View commit details
Showing with 11 additions and 8 deletions.
  1. +3 −3 README.md
  2. +1 −1 lerna.json
  3. +2 −1 packages/craco/README.md
  4. +3 −1 packages/craco/lib/features/webpack/style/postcss.js
  5. +1 −1 packages/craco/package.json
  6. +1 −1 recipes/use-html-loader/craco.config.js
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -44,9 +44,9 @@ All you have to do is create your app using [create-react-app](https://github.co

## Community Maintained Plugins

* [craco-preact](https://github.com/FormAPI/craco-preact) by [@FormAPI](https://github.com/FormAPI)
* [craco-less](https://github.com/FormAPI/craco-less) by [@FormAPI](https://github.com/FormAPI)
* [craco-antd](https://github.com/FormAPI/craco-antd) by [@FormAPI](https://github.com/FormAPI)
* [craco-preact](https://github.com/DocSpring/craco-preact) by [@DocSpring](https://github.com/DocSpring)
* [craco-less](https://github.com/DocSpring/craco-less) by [@DocSpring](https://github.com/DocSpring)
* [craco-antd](https://github.com/DocSpring/craco-antd) by [@DocSpring](https://github.com/DocSpring)
* [craco-plugin-react-hot-reload](https://github.com/HasanAyan/craco-plugin-react-hot-reload) by [@hasanayan](https://github.com/hasanayan)
* [craco-plugin-single-spa-application](https://github.com/hasanayan/craco-plugin-single-spa-application) by [@hasanayan](https://github.com/hasanayan)
* [craco-babel-loader](https://github.com/rjerue/craco-babel-loader) by [@rjerue](https://github.com/rjerue/)
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"packages": ["packages/*"],
"version": "6.1.2"
"version": "6.2.0"
}
3 changes: 2 additions & 1 deletion packages/craco/README.md
Original file line number Diff line number Diff line change
@@ -135,7 +135,8 @@ module.exports = {
},
postcss: {
mode: "extends" /* (default value) */ || "file",
plugins: [],
plugins: [require('plugin-to-append')], // Additional plugins given in an array are appended to existing config.
plugins: (plugins) => [require('plugin-to-prepend')].concat(plugins), // Or you may use the function variant.
env: {
autoprefixer: { /* Any autoprefixer options: https://github.com/postcss/autoprefixer#options */ },
stage: 3, /* Any valid stages: https://cssdb.org/#staging-process. */
4 changes: 3 additions & 1 deletion packages/craco/lib/features/webpack/style/postcss.js
Original file line number Diff line number Diff line change
@@ -58,7 +58,9 @@ function extendsPostcss(match, { plugins, env }) {
}

if (plugins) {
postcssPlugins = postcssPlugins.concat(plugins);
postcssPlugins = typeof plugins === "function"
? plugins(postcssPlugins)
: postcssPlugins.concat(plugins);

log("Added PostCSS plugins.");
}
2 changes: 1 addition & 1 deletion packages/craco/package.json
Original file line number Diff line number Diff line change
@@ -44,6 +44,6 @@
"semver": "^7.3.2",
"webpack-merge": "^4.2.2"
},
"version": "6.1.2",
"version": "6.2.0",
"gitHead": "9c9c5e5ee1f79a17af4809945573bfdbdcc912be"
}
2 changes: 1 addition & 1 deletion recipes/use-html-loader/craco.config.js
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
* To use this, ensure you have added `html-loader` as a dev dependency in your `package.json` first
* Learn more: https://github.com/webpack-contrib/html-loader
*/
const { loaderByName } = require('@craco/craco');
const { loaderByName, addBeforeLoader } = require('@craco/craco');

module.exports = {
webpack: {