craco-alias
Advanced tools
Comparing version 1.0.3 to 1.0.4
{ | ||
"name": "craco-alias", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "A craco plugin for automatic aliases generation", | ||
@@ -5,0 +5,0 @@ "main": "plugin/index.js", |
@@ -6,4 +6,11 @@ # craco-alias | ||
A craco plugin for automatic aliases generation for Webpack and Jest. | ||
A [craco](https://github.com/sharegate/craco) plugin for automatic aliases generation for Webpack and Jest. | ||
## List of Contents | ||
- [Installation](#installation) | ||
- [Options](#options) | ||
- [Examples](#examples) | ||
- [Migrating from cra-alias](#migrating-from-cra-alias) | ||
### Installation | ||
@@ -61,2 +68,4 @@ | ||
```js | ||
/* craco.config.js */ | ||
const CracoAlias = require("craco-alias"); | ||
@@ -159,1 +168,51 @@ | ||
</details> | ||
### Migrating from [cra-alias](https://github.com/risenforces/cra-alias) | ||
1. Install `craco` and `craco-alias`: | ||
```sh | ||
npm i -D @craco/craco craco-alias | ||
``` | ||
2. Create a `craco.config.js` file in the root directory: | ||
> See `tsconfig` example in the [Examples](#examples) section | ||
```js | ||
/* craco.config.js */ | ||
const CracoAlias = require("craco-alias"); | ||
module.exports = { | ||
plugins: [ | ||
{ | ||
plugin: CracoAlias, | ||
options: { | ||
source: "jsconfig" | ||
} | ||
} | ||
] | ||
}; | ||
``` | ||
3. Update the existing calls to `cra-alias` in the `scripts` section of your `package.json` file to use the `craco` CLI: | ||
```diff | ||
/* package.json */ | ||
"scripts": { | ||
- "start": "cra-alias start", | ||
+ "start": "craco start", | ||
- "build": "cra-alias build", | ||
+ "build": "craco build" | ||
- "test": "cra-alias test", | ||
+ "test": "craco test" | ||
} | ||
``` | ||
4. Done! You can also remove `cra-alias`: | ||
```sh | ||
npm r -D cra-alias | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22876
216