Befor generating
This commit is contained in:
+22
@@ -0,0 +1,22 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
# @babel/preset-react
|
||||
|
||||
> Babel preset for all React plugins.
|
||||
|
||||
See our website [@babel/preset-react](https://babeljs.io/docs/babel-preset-react) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22area%3A%20react%22+is%3Aopen) associated with this package.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/preset-react
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/preset-react --dev
|
||||
```
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
var helperPluginUtils = require('@babel/helper-plugin-utils');
|
||||
var transformReactJSX = require('@babel/plugin-transform-react-jsx');
|
||||
var transformReactJSXDevelopment = require('@babel/plugin-transform-react-jsx-development');
|
||||
var transformReactDisplayName = require('@babel/plugin-transform-react-display-name');
|
||||
var transformReactPure = require('@babel/plugin-transform-react-pure-annotations');
|
||||
var helperValidatorOption = require('@babel/helper-validator-option');
|
||||
|
||||
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
||||
|
||||
var transformReactJSX__default = /*#__PURE__*/_interopDefault(transformReactJSX);
|
||||
var transformReactJSXDevelopment__default = /*#__PURE__*/_interopDefault(transformReactJSXDevelopment);
|
||||
var transformReactDisplayName__default = /*#__PURE__*/_interopDefault(transformReactDisplayName);
|
||||
var transformReactPure__default = /*#__PURE__*/_interopDefault(transformReactPure);
|
||||
|
||||
new helperValidatorOption.OptionValidator("@babel/preset-react");
|
||||
function normalizeOptions(options = {}) {
|
||||
let {
|
||||
pragma,
|
||||
pragmaFrag
|
||||
} = options;
|
||||
const {
|
||||
pure,
|
||||
throwIfNamespace = true,
|
||||
runtime = "classic",
|
||||
importSource,
|
||||
useBuiltIns,
|
||||
useSpread
|
||||
} = options;
|
||||
if (runtime === "classic") {
|
||||
pragma = pragma || "React.createElement";
|
||||
pragmaFrag = pragmaFrag || "React.Fragment";
|
||||
}
|
||||
const development = options.development == null ? undefined : !!options.development;
|
||||
return {
|
||||
development,
|
||||
importSource,
|
||||
pragma,
|
||||
pragmaFrag,
|
||||
pure,
|
||||
runtime,
|
||||
throwIfNamespace,
|
||||
useBuiltIns,
|
||||
useSpread
|
||||
};
|
||||
}
|
||||
|
||||
var index = helperPluginUtils.declarePreset((api, opts) => {
|
||||
api.assertVersion(7);
|
||||
const {
|
||||
development = false,
|
||||
importSource,
|
||||
pragma,
|
||||
pragmaFrag,
|
||||
pure,
|
||||
runtime,
|
||||
throwIfNamespace
|
||||
} = normalizeOptions(opts);
|
||||
return {
|
||||
plugins: [[development ? transformReactJSXDevelopment__default.default : transformReactJSX__default.default, {
|
||||
importSource,
|
||||
pragma,
|
||||
pragmaFrag,
|
||||
runtime,
|
||||
throwIfNamespace,
|
||||
pure,
|
||||
useBuiltIns: !!opts.useBuiltIns,
|
||||
useSpread: opts.useSpread
|
||||
}], transformReactDisplayName__default.default, pure !== false && transformReactPure__default.default].filter(Boolean)
|
||||
};
|
||||
});
|
||||
|
||||
exports.default = index;
|
||||
//# sourceMappingURL=index.js.map
|
||||
+1
File diff suppressed because one or more lines are too long
+37
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"name": "@babel/preset-react",
|
||||
"version": "7.29.7",
|
||||
"description": "Babel preset for all React plugins.",
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
"homepage": "https://babel.dev/docs/en/next/babel-preset-react",
|
||||
"bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22area%3A%20react%22+is%3Aopen",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-preset-react"
|
||||
},
|
||||
"main": "./lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.29.7",
|
||||
"@babel/helper-validator-option": "^7.29.7",
|
||||
"@babel/plugin-transform-react-display-name": "^7.29.7",
|
||||
"@babel/plugin-transform-react-jsx": "^7.29.7",
|
||||
"@babel/plugin-transform-react-jsx-development": "^7.29.7",
|
||||
"@babel/plugin-transform-react-pure-annotations": "^7.29.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.29.7",
|
||||
"@babel/helper-plugin-test-runner": "^7.29.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
},
|
||||
"type": "commonjs"
|
||||
}
|
||||
Reference in New Issue
Block a user