Socket
Socket
Sign inDemoInstall

craco-alias

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

craco-alias - npm Package Compare versions

Comparing version 2.1.1 to 2.2.0

.github/ISSUE_TEMPLATE/bug_report.md

2

package.json
{
"name": "craco-alias",
"version": "2.1.1",
"version": "2.2.0",
"description": "A craco plugin for automatic aliases generation",

@@ -5,0 +5,0 @@ "main": "plugin/index.js",

@@ -5,3 +5,3 @@ const exitWithError = message => {

console.log(
'\nPlease read plugin documentation:',
'\nPlugin documentation:',
'\x1b[34mhttps://github.com/risenforces/craco-alias\x1b[0m'

@@ -8,0 +8,0 @@ )

@@ -11,3 +11,3 @@ const checkConfigContents = ({

} catch (err) {
return handleError(`Cannot parse ${configFileName}`)
return handleError(`Cannot parse ${configFileName}. Please validate it on https://jsonformatter.curiousconcept.com.`)
}

@@ -14,0 +14,0 @@

@@ -21,3 +21,3 @@ const check = require('./check-config-contents')

expect(handleErrorMock).toHaveBeenLastCalledWith(
`Cannot parse ${configFileName}`
`Cannot parse ${configFileName}. Please validate it on https://jsonformatter.curiousconcept.com.`
)

@@ -24,0 +24,0 @@ })

@@ -127,7 +127,24 @@ # craco-alias

{
compilerOptions: {
baseUrl: "src",
paths: {
"@file": ["file.js"],
"@dir/*": ["dir/*", "dir"]
"compilerOptions": {
"baseUrl": "./src",
"paths": {
// file aliases
"@baz": ["./baz.js"],
"@boo": ["./boo.jsx"],
// folder aliases
"@root": ["./"],
"@root/*": ["./*"],
"@lib": ["./lib"],
"@lib/*": ["./lib/*"],
// package aliases (types is optional without ts)
"@my-react-select": [
"../node_modules/react-select",
"../node_modules/@types/react-select"
],
"@my-react-select/*": [
"../node_modules/react-select/*",
"../node_modules/@types/react-select"
]
}

@@ -148,11 +165,27 @@ }

3. Edit it as follows:
```js
{
"compilerOptions": {
// baseUrl is optional for plugin, but some IDEs require it
"baseUrl": "src",
"baseUrl": "./src",
"paths": {
"@file-alias": ["./your/file.tsx"],
"@folder-alias/*": ["./very/long/path/*", "./very/long/path/"]
// file aliases
"@baz": ["./baz.ts"],
"@boo": ["./boo.tsx"],
// folder aliases
"@root": ["./"],
"@root/*": ["./*"],
"@lib": ["./lib"],
"@lib/*": ["./lib/*"],
// package aliases
"@my-react-select": [
"../node_modules/react-select",
"../node_modules/@types/react-select"
],
"@my-react-select/*": [
"../node_modules/react-select/*",
"../node_modules/@types/react-select"
]
}

@@ -159,0 +192,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc