Bladeren bron

Replace babel-polyfill with runtime transform

bubble
Josh Ponelat 7 jaren geleden
committed by Josh Ponelat
bovenliggende
commit
4a6716ffed
7 gewijzigde bestanden met toevoegingen van 15 en 18 verwijderingen
  1. +1
    -0
      .babelrc
  2. +1
    -1
      make-webpack-config.js
  3. +1
    -1
      package.json
  4. +1
    -0
      src/core/index.js
  5. +0
    -1
      webpack-dist-bundle.config.js
  6. +10
    -12
      webpack-dist.config.js
  7. +1
    -3
      webpack-hot-dev-server.config.js

+ 1
- 0
.babelrc Bestand weergeven

@@ -5,6 +5,7 @@
"stage-0"
],
"plugins": [
"transform-runtime",
[
"module-alias",
[


+ 1
- 1
make-webpack-config.js Bestand weergeven

@@ -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",
}
},



+ 1
- 1
package.json Bestand weergeven

@@ -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",


+ 1
- 0
src/core/index.js Bestand weergeven

@@ -117,6 +117,7 @@ module.exports = function SwaggerUI(opts) {
return downloadSpec()
}

return system
}

// Add presets


+ 0
- 1
webpack-dist-bundle.config.js Bestand weergeven

@@ -13,7 +13,6 @@ module.exports = require('./make-webpack-config.js')({

entry: {
'swagger-ui-bundle': [
'babel-polyfill',
'./src/core/index.js'
]
},


+ 10
- 12
webpack-dist.config.js Bestand weergeven

@@ -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: {


+ 1
- 3
webpack-hot-dev-server.config.js Bestand weergeven

@@ -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',


Laden…
Annuleren
Opslaan