mirror of
https://github.com/SamEyeBam/animate.git
synced 2025-09-28 06:55:25 +00:00
larry babby and threejs for glsl
This commit is contained in:
48
webGl/my-threejs-test/node_modules/@parcel/transformer-babel/lib/flow.js
generated
vendored
Normal file
48
webGl/my-threejs-test/node_modules/@parcel/transformer-babel/lib/flow.js
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = getFlowOptions;
|
||||
var _constants = require("./constants");
|
||||
function _path() {
|
||||
const data = _interopRequireDefault(require("path"));
|
||||
_path = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
/**
|
||||
* Generates a babel config for stripping away Flow types.
|
||||
*/
|
||||
async function getFlowOptions(config, options) {
|
||||
if (!config.isSource) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Only add flow plugin if `flow-bin` is listed as a dependency in the root package.json
|
||||
let conf = await config.getConfigFrom(options.projectRoot + '/index', ['package.json']);
|
||||
let pkg = conf === null || conf === void 0 ? void 0 : conf.contents;
|
||||
if (!pkg || !(pkg.dependencies && pkg.dependencies['flow-bin']) && !(pkg.devDependencies && pkg.devDependencies['flow-bin'])) {
|
||||
return null;
|
||||
}
|
||||
const babelCore = await options.packageManager.require('@babel/core', config.searchPath, {
|
||||
range: _constants.BABEL_CORE_RANGE,
|
||||
saveDev: true,
|
||||
shouldAutoInstall: options.shouldAutoInstall
|
||||
});
|
||||
await options.packageManager.require('@babel/plugin-transform-flow-strip-types', config.searchPath, {
|
||||
range: '^7.0.0',
|
||||
saveDev: true,
|
||||
shouldAutoInstall: options.shouldAutoInstall
|
||||
});
|
||||
return {
|
||||
plugins: [babelCore.createConfigItem(['@babel/plugin-transform-flow-strip-types', {
|
||||
requireDirective: true
|
||||
}], {
|
||||
type: 'plugin',
|
||||
dirname: _path().default.dirname(config.searchPath)
|
||||
})]
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user