Parse import-assertions (#12139)

Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
This commit is contained in:
Sven Sauleau
2020-10-14 20:18:16 +01:00
committed by GitHub
parent 59d97d9bca
commit af8e0facc1
71 changed files with 1199 additions and 112 deletions

View File

@@ -0,0 +1,19 @@
# @babel/plugin-syntax-import-assertions
> Allow parsing of the module assertion attributes in the import statements
See our website [@babel/plugin-syntax-import-assertions](https://babeljs.io/docs/en/next/babel-plugin-syntax-import-assertions.html) for more information.
## Install
Using npm:
```sh
npm install --save-dev @babel/plugin-syntax-import-assertions
```
or using yarn:
```sh
yarn add @babel/plugin-syntax-import-assertions --dev
```

View File

@@ -0,0 +1,27 @@
{
"name": "@babel/plugin-syntax-import-assertions",
"version": "7.10.4",
"description": "Allow parsing of the module assertion attributes in the import statement",
"repository": {
"type": "git",
"url": "https://github.com/babel/babel.git",
"directory": "packages/babel-plugin-syntax-import-assertions"
},
"license": "MIT",
"publishConfig": {
"access": "public"
},
"main": "lib/index.js",
"keywords": [
"babel-plugin"
],
"dependencies": {
"@babel/helper-plugin-utils": "workspace:^7.10.4"
},
"peerDependencies": {
"@babel/core": "^7.0.0-0"
},
"devDependencies": {
"@babel/core": "workspace:^7.10.4"
}
}

View File

@@ -0,0 +1,13 @@
import { declare } from "@babel/helper-plugin-utils";
export default declare(api => {
api.assertVersion(7);
return {
name: "syntax-import-assertions",
manipulateOptions(opts, parserOpts) {
parserOpts.plugins.push(["importAssertions"]);
},
};
});