提交 55e4a125 编写于 作者: S shockey 提交者: GitHub

Merge pull request #2959 from swagger-api/feature/remove-babel-polyfill

Replace babel-polyfill with transform-runtime
......@@ -5,6 +5,7 @@
"stage-0"
],
"plugins": [
"transform-runtime",
[
"module-alias",
[
......
此差异已折叠。
{"version":3,"file":"swagger-ui-bundle.js","sources":["webpack:///swagger-ui-bundle.js"],"mappings":"AAAA;AAu/FA;AA6+FA;;;;;;;;;;;;;;;;;;;;;;;;;;AA2TA;;;;;;AAoIA;AAi7FA;AAmtCA;AAi0IA;AAioJA;AA2iGA;AAs+FA;AA4kFA;AA6jFA;AAm9CA;AA6jDA;AAgrCA;AA+/EA;;;;;AAu3BA;AA0qJA;;;;;;;;;;;;;;AAwoFA;AA+lIA;AA2hJA;AAo2HA;AA8lGA;AAwiEA;AAo4DA;AAk7DA;AAyHA;;;;;;AA6iGA;AA07FA;;;;;AAi8CA;AAgsFA;AAs2CA;AAilCA;AA+7CA;AA85DA;AA4zCA;AAs5FA;;;;;;;;;AAqlCA;AA2zIA;AAu7FA;AAmrFA;AA20EA","sourceRoot":""}
\ No newline at end of file
{"version":3,"file":"swagger-ui-bundle.js","sources":["webpack:///swagger-ui-bundle.js"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;AAmqDA;AAorJA;AAiiCA;AAo1GA;AA4qHA;AAw8FA;AAujFA;AA0sDA;AAm/CA;AA+jDA;AAk/CA;;;;;AA60EA;AA8zJA;;;;;;;;;;;;;;AAyoFA;AA+lIA;AA4oJA;AAqvHA;AAknGA;AA4iEA;AA43DA;AAkqDA;AAidA;;;;;;AAkxGA;AA+1HA;AA0+DA;;;;;AAwiBA;AAgsFA;AA6kDA;AAq3CA;AA4wFA;AAk3CA;AA2iFA;;;;;;;;;AAwqEA;AA2zIA;AAu7FA;AAmrFA;AAi7EA;;;;;;AAiRA;AAuqHA;AAg8GA","sourceRoot":""}
\ No newline at end of file
{"version":3,"file":"swagger-ui-standalone-preset.js","sources":["webpack:///swagger-ui-standalone-preset.js"],"mappings":"AAAA;;;;;AA0SA;AAgyGA;AAuxFA;;;;;;AAocA;AAkvFA;AAu+CA;AAo+CA;AAgrCA;AAuyEA","sourceRoot":""}
\ No newline at end of file
{"version":3,"file":"swagger-ui-standalone-preset.js","sources":["webpack:///swagger-ui-standalone-preset.js"],"mappings":"AAAA;AA+uFA;;;;;AAyOA;AAo7GA;AAw0FA;;;;;;AAmZA;AA+uFA;AAy+CA;AAo+CA;AAirCA;AAuyEA","sourceRoot":""}
\ No newline at end of file
此差异已折叠。
{"version":3,"file":"swagger-ui.js","sources":["webpack:///swagger-ui.js"],"mappings":"AAAA;;;;;;AAizCA;AAoyHA;AAmyHA;AAukGA;AA+9BA;AA8jCA;AAyiCA;AAs5BA","sourceRoot":""}
\ No newline at end of file
{"version":3,"file":"swagger-ui.js","sources":["webpack:///swagger-ui.js"],"mappings":"AAAA;AAylFA;;;;;;AAw4CA;AA2pHA;AA48HA;AAkoGA;AA0zDA;AAmzCA;AA+xCA","sourceRoot":""}
\ No newline at end of file
......@@ -147,7 +147,7 @@ module.exports = function(options) {
extensions: ["", ".web.js", ".js", ".jsx", ".json", ".less"],
packageAlias: 'browser',
alias: {
base: "getbase/src/less/base"
base: "getbase/src/less/base",
}
},
......
......@@ -35,7 +35,6 @@
"just-test-in-node": "mocha --recursive --compilers js:babel-core/register test/core test/components test/bugs test/swagger-ui-dist-package"
},
"dependencies": {
"babel-polyfill": "^6.23.0",
"base64-js": "^1.2.0",
"brace": "0.7.0",
"deep-extend": "0.4.1",
......@@ -83,6 +82,7 @@
"babel-eslint": "^7.1.1",
"babel-loader": "^6.3.2",
"babel-plugin-module-alias": "^1.6.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-es2015": "^6.22.0",
"babel-preset-es2015-ie": "^6.6.2",
"babel-preset-react": "^6.23.0",
......@@ -132,7 +132,7 @@
"browserslist": [
"> 1%",
"last 2 versions",
"IE 10"
"IE 11"
],
"optionalDependencies": {
"webpack-dev-server": "1.14.0"
......
......@@ -117,6 +117,7 @@ module.exports = function SwaggerUI(opts) {
return downloadSpec()
}
return system
}
// Add presets
......
import { fromJS } from "immutable"
import { fromJSOrdered, validateParam } from "core/utils"
import win from "../../window"
import findIndex from "lodash/findIndex"
import {
UPDATE_SPEC,
......@@ -41,7 +42,7 @@ export default {
[UPDATE_PARAM]: ( state, {payload} ) => {
let { path, paramName, value, isXml } = payload
return state.updateIn( [ "resolved", "paths", ...path, "parameters" ], fromJS([]), parameters => {
let index = parameters.findIndex( p => p.get( "name" ) === paramName )
const index = findIndex(parameters, p => p.get( "name" ) === paramName )
if (!(value instanceof win.File)) {
value = fromJSOrdered( value )
}
......
import Im from "immutable"
import shallowEqual from "shallowequal"
import camelCase from "lodash/camelCase"
import upperFirst from "lodash/upperFirst"
......@@ -418,11 +417,6 @@ export function pascalCaseFilename(filename) {
return pascalCase(filename.replace(/\.[^./]*$/, ""))
}
// Only compare a set of props
export function shallowEqualKeys(a,b, keys) {
return !!keys.find(key => !shallowEqual(a[key], b[key]))
}
// Check if ...
// - new props
// - If immutable, use .is()
......
// Promise global, Used ( at least ) by 'whatwg-fetch'. And required by IE 11
require("core-js/fn/promise")
......@@ -13,7 +13,7 @@ module.exports = require('./make-webpack-config.js')({
entry: {
'swagger-ui-bundle': [
'babel-polyfill',
'./src/polyfills',
'./src/core/index.js'
]
},
......
......@@ -13,6 +13,7 @@ module.exports = require('./make-webpack-config.js')({
entry: {
'swagger-ui-standalone-preset': [
'./src/polyfills',
'./src/standalone/index.js'
]
},
......
var path = require('path')
var fs = require('fs')
var node_modules = fs.readdirSync('node_modules').filter(function(x) { return x !== '.bin' })
const path = require("path")
const fs = require("fs")
const nodeModules = fs.readdirSync("node_modules").filter(function(x) { return x !== ".bin" })
module.exports = require('./make-webpack-config.js')({
module.exports = require("./make-webpack-config.js")({
_special: {
separateStylesheets: true,
minimize: true,
......@@ -15,9 +14,9 @@ module.exports = require('./make-webpack-config.js')({
entry: {
"swagger-ui": [
'babel-polyfill',
'./src/style/main.scss',
'./src/core/index.js'
"./src/style/main.scss",
"./src/polyfills",
"./src/core/index.js"
]
},
......@@ -25,11 +24,11 @@ module.exports = require('./make-webpack-config.js')({
// webpack injects some stuff into the resulting file,
// these libs need to be pulled in to keep that working.
var exceptionsForWebpack = ["ieee754", "base64-js"]
if(node_modules.indexOf(request) !== -1 || exceptionsForWebpack.indexOf(request) !== -1) {
cb(null, 'commonjs ' + request)
return;
if(nodeModules.indexOf(request) !== -1 || exceptionsForWebpack.indexOf(request) !== -1) {
cb(null, "commonjs " + request)
return
}
cb();
cb()
},
output: {
......
......@@ -10,12 +10,12 @@ module.exports = require("./make-webpack-config")({
devtool: "eval",
entry: {
'swagger-ui-bundle': [
'webpack/hot/dev-server',
'babel-polyfill',
'./src/core/index.js',
'./src/polyfills',
'./src/core/index.js'
],
'swagger-ui-standalone-preset': [
'webpack/hot/dev-server',
'./src/polyfills',
'./src/standalone/index.js',
]
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册