diff --git a/packages/cra-plugin-css-modules/README.md b/packages/react-scripts-plugin-css-modules/README.md similarity index 91% rename from packages/cra-plugin-css-modules/README.md rename to packages/react-scripts-plugin-css-modules/README.md index 528425fc003..0e82785556c 100644 --- a/packages/cra-plugin-css-modules/README.md +++ b/packages/react-scripts-plugin-css-modules/README.md @@ -5,7 +5,7 @@ Enable [CSS Modules](https://github.com/css-modules/css-modules) in your CRA app ## Install ```bash -yarn add -D cra-plugin-css-modules +yarn add -D react-scripts-plugin-css-modules ``` Add to `cra.config.js` diff --git a/packages/cra-plugin-css-modules/index.js b/packages/react-scripts-plugin-css-modules/index.js similarity index 80% rename from packages/cra-plugin-css-modules/index.js rename to packages/react-scripts-plugin-css-modules/index.js index ec0954857d1..c74dac21a22 100644 --- a/packages/cra-plugin-css-modules/index.js +++ b/packages/react-scripts-plugin-css-modules/index.js @@ -1,6 +1,6 @@ 'use strict'; -const { findCssLoader } = require('cra-plugin-utils'); +const { findCssLoader } = require('react-scripts-plugin-utils'); module.exports = { webpack: config => { diff --git a/packages/cra-plugin-css-modules/package.json b/packages/react-scripts-plugin-css-modules/package.json similarity index 73% rename from packages/cra-plugin-css-modules/package.json rename to packages/react-scripts-plugin-css-modules/package.json index cff91f89e40..d289924d3a1 100644 --- a/packages/cra-plugin-css-modules/package.json +++ b/packages/react-scripts-plugin-css-modules/package.json @@ -1,5 +1,5 @@ { - "name": "cra-plugin-css-modules", + "name": "react-scripts-plugin-css-modules", "version": "0.2.0", "description": "CSS Modules plugin for Create React App", "main": "index.js", @@ -7,6 +7,6 @@ "author": "Jon Crenshaw ", "license": "MIT", "dependencies": { - "cra-plugin-utils": "^0.2.0" + "react-scripts-plugin-utils": "^0.2.0" } } diff --git a/packages/cra-plugin-no-hashes/README.md b/packages/react-scripts-plugin-no-hashes/README.md similarity index 93% rename from packages/cra-plugin-no-hashes/README.md rename to packages/react-scripts-plugin-no-hashes/README.md index 089c65b116d..d97755052bb 100644 --- a/packages/cra-plugin-no-hashes/README.md +++ b/packages/react-scripts-plugin-no-hashes/README.md @@ -5,7 +5,7 @@ Disables file hashes (ie. `main.35dbe941.js`) in your CRA app's build output. ## Install ```bash -yarn add -D cra-plugin-no-hashes +yarn add -D react-scripts-plugin-no-hashes ``` Add to `cra.config.js` diff --git a/packages/cra-plugin-no-hashes/index.js b/packages/react-scripts-plugin-no-hashes/index.js similarity index 90% rename from packages/cra-plugin-no-hashes/index.js rename to packages/react-scripts-plugin-no-hashes/index.js index e22436ec751..01df768ae7b 100644 --- a/packages/cra-plugin-no-hashes/index.js +++ b/packages/react-scripts-plugin-no-hashes/index.js @@ -1,6 +1,6 @@ 'use strict'; -const { isEnabled } = require('cra-plugin-utils'); +const { isEnabled } = require('react-scripts-plugin-utils'); module.exports = { webpack: (config, { env }) => { diff --git a/packages/cra-plugin-no-hashes/package.json b/packages/react-scripts-plugin-no-hashes/package.json similarity index 75% rename from packages/cra-plugin-no-hashes/package.json rename to packages/react-scripts-plugin-no-hashes/package.json index c01a468b75c..9f4d580c6f4 100644 --- a/packages/cra-plugin-no-hashes/package.json +++ b/packages/react-scripts-plugin-no-hashes/package.json @@ -1,5 +1,5 @@ { - "name": "cra-plugin-no-hashes", + "name": "react-scripts-plugin-no-hashes", "version": "0.2.0", "description": "Plugin to disable file hashes for Create React App", "main": "index.js", @@ -7,6 +7,6 @@ "author": "Jon Crenshaw ", "license": "MIT", "dependencies": { - "cra-plugin-utils": "^0.2.0" + "react-scripts-plugin-utils": "^0.2.0" } } diff --git a/packages/cra-plugin-no-minify/README.md b/packages/react-scripts-plugin-no-minify/README.md similarity index 93% rename from packages/cra-plugin-no-minify/README.md rename to packages/react-scripts-plugin-no-minify/README.md index d6d9f960b91..92753fca1c1 100644 --- a/packages/cra-plugin-no-minify/README.md +++ b/packages/react-scripts-plugin-no-minify/README.md @@ -5,7 +5,7 @@ Disable build minification in your CRA app's build output. ## Install ```bash -yarn add -D cra-plugin-no-minify +yarn add -D react-scripts-plugin-no-minify ``` Add to `cra.config.js` diff --git a/packages/cra-plugin-no-minify/index.js b/packages/react-scripts-plugin-no-minify/index.js similarity index 83% rename from packages/cra-plugin-no-minify/index.js rename to packages/react-scripts-plugin-no-minify/index.js index 5b509d35397..17d2333c997 100644 --- a/packages/cra-plugin-no-minify/index.js +++ b/packages/react-scripts-plugin-no-minify/index.js @@ -1,6 +1,10 @@ 'use strict'; -const { findCssLoader, filterPlugins, isEnabled } = require('cra-plugin-utils'); +const { + findCssLoader, + filterPlugins, + isEnabled, +} = require('react-scripts-plugin-utils'); module.exports = { webpack: (config, { env }) => { diff --git a/packages/cra-plugin-no-minify/package.json b/packages/react-scripts-plugin-no-minify/package.json similarity index 75% rename from packages/cra-plugin-no-minify/package.json rename to packages/react-scripts-plugin-no-minify/package.json index b226c6d4a02..49a1816b7c9 100644 --- a/packages/cra-plugin-no-minify/package.json +++ b/packages/react-scripts-plugin-no-minify/package.json @@ -1,5 +1,5 @@ { - "name": "cra-plugin-no-minify", + "name": "react-scripts-plugin-no-minify", "version": "0.2.0", "description": "Plugin to disable minification for Create React App", "main": "index.js", @@ -7,6 +7,6 @@ "author": "Jon Crenshaw ", "license": "MIT", "dependencies": { - "cra-plugin-utils": "^0.2.0" + "react-scripts-plugin-utils": "^0.2.0" } } diff --git a/packages/cra-plugin-utils/README.md b/packages/react-scripts-plugin-utils/README.md similarity index 90% rename from packages/cra-plugin-utils/README.md rename to packages/react-scripts-plugin-utils/README.md index 6ad8f1f8f27..0a28583e547 100644 --- a/packages/cra-plugin-utils/README.md +++ b/packages/react-scripts-plugin-utils/README.md @@ -6,7 +6,7 @@ _Note: This plugin system is unsupported by the CRA team and will not work with ## What is a plugin? -* Naming convension for plugin modules is `cra-plugin-NAME` (scoped modules are supported). +* Naming convension for plugin modules is `react-scripts-plugin-NAME` (scoped modules are supported). * Plugins are loaded via the `plugins` array in `cra.config.js`. * A plugin is a simple module exporting the feature(s) that it supports. * Plugins have some access to Create React App internals through an `options` object passed to it. If there's an aspect of the internals that aren't provided, open a PR to request it. @@ -14,7 +14,7 @@ _Note: This plugin system is unsupported by the CRA team and will not work with ## Install ```bash -yarn add cra-plugin-utils +yarn add react-scripts-plugin-utils ``` ## Features @@ -32,7 +32,7 @@ It will be passed the config object and some options. #### Example -`cra-plugin-example/index.js` +`react-scripts-plugin-example/index.js` ```js module.exports = { diff --git a/packages/cra-plugin-utils/index.js b/packages/react-scripts-plugin-utils/index.js similarity index 100% rename from packages/cra-plugin-utils/index.js rename to packages/react-scripts-plugin-utils/index.js diff --git a/packages/cra-plugin-utils/package.json b/packages/react-scripts-plugin-utils/package.json similarity index 85% rename from packages/cra-plugin-utils/package.json rename to packages/react-scripts-plugin-utils/package.json index 2a02c92a85d..4c6298f5de9 100644 --- a/packages/cra-plugin-utils/package.json +++ b/packages/react-scripts-plugin-utils/package.json @@ -1,5 +1,5 @@ { - "name": "cra-plugin-utils", + "name": "react-scripts-plugin-utils", "version": "0.2.0", "description": "Core utilities for Create React App plugins", "main": "index.js", diff --git a/packages/react-scripts/README.md b/packages/react-scripts/README.md index e43e5feec59..de1ee6493a4 100644 --- a/packages/react-scripts/README.md +++ b/packages/react-scripts/README.md @@ -19,10 +19,10 @@ The ES5 module exported by `cra.config.js` at the app's root is used for configu ```js module.exports = { // Load plugins by name and/or by reference. Loading plugins by name is for - // convenience, eg. `'css-modules'` is the same as `require('cra-plugin-css-modules')` + // convenience, eg. `'css-modules'` is the same as `require('react-scripts-plugin-css-modules')` plugins: ['css-modules', require('./my-internal-plugin')], - // Webpack configuration (see `cra-plugin-utils` for info) + // Webpack configuration (see `react-scripts-plugin-utils` for info) webpack: (config, options) => { return config; }, @@ -31,10 +31,10 @@ module.exports = { ## Plugin Development -See [cra-plugin-utils](https://www.npmjs.com/package/cra-plugin-utils) +See [react-scripts-plugin-utils](https://www.npmjs.com/package/react-scripts-plugin-utils) ## Plugin Listing -* [cra-plugin-css-modules](https://www.npmjs.com/package/cra-plugin-css-modules) -* [cra-plugin-no-hashes](https://www.npmjs.com/package/cra-plugin-no-hashes) -* [cra-plugin-no-minify](https://www.npmjs.com/package/cra-plugin-no-minify) +* [react-scripts-plugin-css-modules](https://www.npmjs.com/package/react-scripts-plugin-css-modules) +* [react-scripts-plugin-no-hashes](https://www.npmjs.com/package/react-scripts-plugin-no-hashes) +* [react-scripts-plugin-no-minify](https://www.npmjs.com/package/react-scripts-plugin-no-minify) diff --git a/packages/react-scripts/config/configure.js b/packages/react-scripts/config/configure.js index a7ae96360ff..ee9b6a7c08b 100644 --- a/packages/react-scripts/config/configure.js +++ b/packages/react-scripts/config/configure.js @@ -12,7 +12,10 @@ const loadPlugins = (plugins = []) => { if (isPlainObject(p)) { return p; } else if (typeof p === 'string') { - const pluginPath = path.resolve(paths.appNodeModules, `cra-plugin-${p}`); + const pluginPath = path.resolve( + paths.appNodeModules, + `react-scripts-plugin-${p}` + ); if (fs.existsSync(pluginPath)) { return require(pluginPath); } else { diff --git a/packages/react-scripts/template/cra.config.js b/packages/react-scripts/template/cra.config.js index e69de29bb2d..8b46fbbaadf 100644 --- a/packages/react-scripts/template/cra.config.js +++ b/packages/react-scripts/template/cra.config.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = {};