Skip to content

Commit

Permalink
Add @babel/plugin-syntax-import-defer
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Sep 5, 2023
1 parent 63606c9 commit 95b4b22
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 0 deletions.
19 changes: 19 additions & 0 deletions packages/babel-plugin-syntax-import-defer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# @babel/plugin-syntax-import-defer

> Allow parsing of the `import defer` syntax in import statement
See our website [@babel/plugin-syntax-import-defer](https://babeljs.io/docs/babel-plugin-syntax-import-defer) for more information.

## Install

Using npm:

```sh
npm install --save-dev @babel/plugin-syntax-import-defer
```

or using yarn:

```sh
yarn add @babel/plugin-syntax-import-defer --dev
```
54 changes: 54 additions & 0 deletions packages/babel-plugin-syntax-import-defer/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"name": "@babel/plugin-syntax-import-defer",
"version": "7.22.5",
"description": "Allow parsing of the `import defer` syntax in import statement",
"repository": {
"type": "git",
"url": "https://github.com/babel/babel.git",
"directory": "packages/babel-plugin-syntax-import-defer"
},
"license": "MIT",
"publishConfig": {
"access": "public"
},
"main": "./lib/index.js",
"keywords": [
"babel-plugin"
],
"dependencies": {
"@babel/helper-plugin-utils": "workspace:^"
},
"peerDependencies": {
"@babel/core": "^7.0.0-0"
},
"devDependencies": {
"@babel/core": "workspace:^"
},
"engines": {
"node": ">=6.9.0"
},
"author": "The Babel Team (https://babel.dev/team)",
"conditions": {
"BABEL_8_BREAKING": [
{
"engines": {
"node": "^16.20.0 || ^18.16.0 || >=20.0.0"
}
},
{
"exports": null
}
],
"USE_ESM": [
{
"type": "module"
},
null
]
},
"exports": {
".": "./lib/index.js",
"./package.json": "./package.json"
},
"type": "commonjs"
}
13 changes: 13 additions & 0 deletions packages/babel-plugin-syntax-import-defer/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { declare } from "@babel/helper-plugin-utils";

export default declare(api => {
api.assertVersion(7);

return {
name: "syntax-import-defer",

manipulateOptions(_, parserOpts) {
parserOpts.plugins.push("deferredImportEvaluation");
},
};
});
4 changes: 4 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"./packages/babel-plugin-syntax-function-sent/src/**/*.ts",
"./packages/babel-plugin-syntax-import-assertions/src/**/*.ts",
"./packages/babel-plugin-syntax-import-attributes/src/**/*.ts",
"./packages/babel-plugin-syntax-import-defer/src/**/*.ts",
"./packages/babel-plugin-syntax-import-reflection/src/**/*.ts",
"./packages/babel-plugin-syntax-jsx/src/**/*.ts",
"./packages/babel-plugin-syntax-module-blocks/src/**/*.ts",
Expand Down Expand Up @@ -374,6 +375,9 @@
"@babel/plugin-syntax-import-attributes": [
"./packages/babel-plugin-syntax-import-attributes/src"
],
"@babel/plugin-syntax-import-defer": [
"./packages/babel-plugin-syntax-import-defer/src"
],
"@babel/plugin-syntax-import-reflection": [
"./packages/babel-plugin-syntax-import-reflection/src"
],
Expand Down
11 changes: 11 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1909,6 +1909,17 @@ __metadata:
languageName: unknown
linkType: soft

"@babel/plugin-syntax-import-defer@workspace:^, @babel/plugin-syntax-import-defer@workspace:packages/babel-plugin-syntax-import-defer":
version: 0.0.0-use.local
resolution: "@babel/plugin-syntax-import-defer@workspace:packages/babel-plugin-syntax-import-defer"
dependencies:
"@babel/core": "workspace:^"
"@babel/helper-plugin-utils": "workspace:^"
peerDependencies:
"@babel/core": ^7.0.0-0
languageName: unknown
linkType: soft

"@babel/plugin-syntax-import-meta-BABEL_8_BREAKING-false@npm:@babel/plugin-syntax-import-meta@^7.10.4, @babel/plugin-syntax-import-meta@npm:^7.8.3":
version: 7.10.4
resolution: "@babel/plugin-syntax-import-meta@npm:7.10.4"
Expand Down

0 comments on commit 95b4b22

Please sign in to comment.