Replace babel-polyfill with runtime transform
This commit is contained in:
committed by
Josh Ponelat
parent
00745bca38
commit
4a6716ffed
1
.babelrc
1
.babelrc
@@ -5,6 +5,7 @@
|
||||
"stage-0"
|
||||
],
|
||||
"plugins": [
|
||||
"transform-runtime",
|
||||
[
|
||||
"module-alias",
|
||||
[
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -117,6 +117,7 @@ module.exports = function SwaggerUI(opts) {
|
||||
return downloadSpec()
|
||||
}
|
||||
|
||||
return system
|
||||
}
|
||||
|
||||
// Add presets
|
||||
|
||||
@@ -13,7 +13,6 @@ module.exports = require('./make-webpack-config.js')({
|
||||
|
||||
entry: {
|
||||
'swagger-ui-bundle': [
|
||||
'babel-polyfill',
|
||||
'./src/core/index.js'
|
||||
]
|
||||
},
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
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,8 @@ 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/core/index.js"
|
||||
]
|
||||
},
|
||||
|
||||
@@ -25,11 +23,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,9 +10,7 @@ module.exports = require("./make-webpack-config")({
|
||||
devtool: "eval",
|
||||
entry: {
|
||||
'swagger-ui-bundle': [
|
||||
'webpack/hot/dev-server',
|
||||
'babel-polyfill',
|
||||
'./src/core/index.js',
|
||||
'./src/core/index.js'
|
||||
],
|
||||
'swagger-ui-standalone-preset': [
|
||||
'webpack/hot/dev-server',
|
||||
|
||||
Reference in New Issue
Block a user