@isograph/babel-plugin 0.0.0-main-b5263898 → 0.0.0-main-7003bd25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +35 -0
  2. package/package.json +2 -2
package/README.md ADDED
@@ -0,0 +1,35 @@
1
+ # `@isograph/babel-plugin`
2
+
3
+ This package exposes a babel plugin for use with Isograph. It is highly recommended.
4
+
5
+ ## Installation:
6
+
7
+ First, install the package:
8
+
9
+ ```bash
10
+ yarn add @isograph/babel-plugin@0.0.0-main-b5263898
11
+ ```
12
+
13
+ Next, add it to your `.babelrc`:
14
+
15
+ ```js
16
+ module.exports = {
17
+ plugins: ["@isograph"],
18
+ };
19
+ ```
20
+
21
+ ## What does it do?
22
+
23
+ This package changes calls to `isoFetch` to `require` calls for the generated artifact. For example, `` isoFetch`Query.home_page` `` might get replaced with `require("../__isograph/Query/home_page/entrypoint.isograph.ts")`.
24
+
25
+ ## Requirements
26
+
27
+ For this babel plugin to work, it must find an `isograph.config.json` file. It is safe to put one at the root of your project.
28
+
29
+ :::warning
30
+ `yarn iso --config $PATH` will work if the config is not named `isograph.config.json`, or is not found in the root of the project. But the babel plugin will not (yet!)
31
+ :::
32
+
33
+ ## What about SWC?
34
+
35
+ The backlog includes developing an SWC plugin. It has not been done, yet.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@isograph/babel-plugin",
3
3
  "description": "A Babel plugin for use with Isograph applications.",
4
- "version": "0.0.0-main-b5263898",
4
+ "version": "0.0.0-main-7003bd25",
5
5
  "keywords": [
6
6
  "graphql",
7
7
  "isograph",
@@ -12,7 +12,7 @@
12
12
  "repository": {
13
13
  "type": "git",
14
14
  "url": "https://github.com/isographlabs/isograph",
15
- "directory": "libs/isograph-babel"
15
+ "directory": "libs/isograph-babel-plugin"
16
16
  },
17
17
  "dependencies": {
18
18
  "babel-plugin-macros": "^2.0.0",