housekeeping: upgrade to babel@7 (via #5450)
* Babel 7 * preserve module output; straighten out ES/CJS syntax * add webpack TODOs * remove unused Babel modules * Update index.js * install @babel/register
This commit is contained in:
@@ -1,11 +1,15 @@
|
||||
import deepExtend from "deep-extend"
|
||||
// This file uses CommonJS require/exports syntax in order to export the SwaggerUI
|
||||
// function directly, instead of `{ default: fn SwaggerUI }`, which Babel would
|
||||
// generate if we used ESM syntax.
|
||||
|
||||
import System from "core/system"
|
||||
import win from "core/window"
|
||||
import ApisPreset from "core/presets/apis"
|
||||
const deepExtend = require("deep-extend")
|
||||
|
||||
const System = require("core/system").default
|
||||
const ApisPreset = require("core/presets/apis").default
|
||||
const AllPlugins = require("core/plugins/all").default
|
||||
const { parseSearch } = require("core/utils")
|
||||
const win = require("core/window")
|
||||
|
||||
import * as AllPlugins from "core/plugins/all"
|
||||
import { parseSearch } from "core/utils"
|
||||
|
||||
if (process.env.NODE_ENV !== "production" && typeof window !== "undefined") {
|
||||
win.Perf = require("react-dom/lib/ReactPerf")
|
||||
|
||||
@@ -2,6 +2,8 @@ import { pascalCaseFilename } from "core/utils"
|
||||
|
||||
const request = require.context(".", true, /\.jsx?$/)
|
||||
|
||||
const allPlugins = {}
|
||||
|
||||
request.keys().forEach( function( key ){
|
||||
if( key === "./index.js" ) {
|
||||
return
|
||||
@@ -13,5 +15,7 @@ request.keys().forEach( function( key ){
|
||||
// }
|
||||
|
||||
let mod = request(key)
|
||||
module.exports[pascalCaseFilename(key)] = mod.default ? mod.default : mod
|
||||
allPlugins[pascalCaseFilename(key)] = mod.default ? mod.default : mod
|
||||
})
|
||||
|
||||
export default allPlugins
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React, { Component } from "react"
|
||||
import PropTypes from "prop-types"
|
||||
import { OAS3ComponentWrapFactory } from "../helpers"
|
||||
import { Model } from "core/components/model"
|
||||
import Model from "core/components/model"
|
||||
|
||||
class ModelComponent extends Component {
|
||||
static propTypes = {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Swagger from "swagger-client"
|
||||
import * as configsWrapActions from "./configs-wrap-actions"
|
||||
|
||||
module.exports = function({ configs, getConfigs }) {
|
||||
export default function({ configs, getConfigs }) {
|
||||
return {
|
||||
fn: {
|
||||
fetch: Swagger.makeHttp(configs.preFetch, configs.postFetch),
|
||||
|
||||
Reference in New Issue
Block a user