Bläddra i källkod

Merge branch 'master' into master

bubble
Ron 7 år sedan
committed by GitHub
förälder
incheckning
d953b7790d
22 ändrade filer med 225 tillägg och 246 borttagningar
  1. +2
    -2
      README.md
  2. +18
    -18
      dist/swagger-ui-bundle.js
  3. +1
    -1
      dist/swagger-ui-bundle.js.map
  4. +1
    -1
      dist/swagger-ui.css
  5. +1
    -1
      dist/swagger-ui.js
  6. +1
    -1
      dist/swagger-ui.js.map
  7. +1
    -1
      make-webpack-config.js
  8. +2
    -2
      package.json
  9. +1
    -0
      src/core/components/providers/markdown.jsx
  10. +3
    -3
      src/core/plugins/auth/selectors.js
  11. +2
    -2
      src/core/plugins/oas3/auth-extensions/wrap-selectors.js
  12. +5
    -2
      src/core/plugins/spec/actions.js
  13. +2
    -2
      src/core/plugins/spec/reducers.js
  14. +4
    -0
      src/core/plugins/spec/wrap-actions.js
  15. +10
    -8
      src/core/utils.js
  16. +0
    -8
      src/style/_layout.scss
  17. +6
    -0
      test/components/markdown.js
  18. +160
    -183
      test/core/utils.js
  19. +1
    -1
      webpack-dist-bundle.config.js
  20. +1
    -1
      webpack-dist-standalone.config.js
  21. +1
    -1
      webpack-dist.config.js
  22. +2
    -8
      webpack-hot-dev-server.config.js

+ 2
- 2
README.md Visa fil

@@ -6,7 +6,7 @@

**This is the new version of swagger-ui, 3.x. Want to learn more? Check out our [FAQ](http://swagger.io/new-ui-faq/).**

**👉🏼 Want to score an easy open-source contribution?** Check out our [Good first contribution](https://github.com/swagger-api/swagger-ui/issues?q=is%3Aissue+is%3Aopen+label%3A%22Good+first+contribution%22) label.
**👉🏼 Want to score an easy open-source contribution?** Check out our [Good first issue](https://github.com/swagger-api/swagger-ui/issues?q=is%3Aissue+is%3Aopen+label%3A%22Good+first+issue%22) label.

As a brand new version, written from the ground up, there are some known issues and unimplemented features. Check out the [Known Issues](#known-issues) section for more details.

@@ -22,7 +22,7 @@ The OpenAPI Specification has undergone 5 revisions since initial creation in 20

Swagger UI Version | Release Date | OpenAPI Spec compatibility | Notes
------------------ | ------------ | -------------------------- | -----
3.3.1 | 2017-10-02 | 2.0, 3.0 | [tag v3.3.1](https://github.com/swagger-api/swagger-ui/tree/v3.3.1)
3.3.2 | 2017-10-13 | 2.0, 3.0 | [tag v3.3.2](https://github.com/swagger-api/swagger-ui/tree/v3.3.2)
3.0.21 | 2017-07-26 | 2.0 | [tag v3.0.21](https://github.com/swagger-api/swagger-ui/tree/v3.0.21)
2.2.10 | 2017-01-04 | 1.1, 1.2, 2.0 | [tag v2.2.10](https://github.com/swagger-api/swagger-ui/tree/v2.2.10)
2.1.5 | 2016-07-20 | 1.1, 1.2, 2.0 | [tag v2.1.5](https://github.com/swagger-api/swagger-ui/tree/v2.1.5)


+ 18
- 18
dist/swagger-ui-bundle.js
Filskillnaden har hållits tillbaka eftersom den är för stor
Visa fil


+ 1
- 1
dist/swagger-ui-bundle.js.map Visa fil

@@ -1 +1 @@
{"version":3,"file":"swagger-ui-bundle.js","sources":["webpack:///swagger-ui-bundle.js"],"mappings":"AAAA;;;;;AAonMA;;;;;;AAm5DA;;;;;;;;;;;;;;;;;;;;;;;;;;AAukUA;;;;;;;;;;;;;;AAq4JA;AA4+iBA;;;;;;;;;AA8oIA;;;;;AA87QA;;;;;AAynBA;AAo0CA;;;;;;AA6gZA;;;;;;AAkzZA;AAixYA","sourceRoot":""}
{"version":3,"file":"swagger-ui-bundle.js","sources":["webpack:///swagger-ui-bundle.js"],"mappings":"AAAA;;;;;AAsnMA;;;;;;AAm5DA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0kUA;;;;;;;;;;;;;;AAq4JA;AA4/iBA;;;;;;;;;AA+vIA;;;;;AAk8QA;;;;;AAynBA;AAo0CA;;;;;;AAuqxBA;AAixYA;;;;;;AA6gbA","sourceRoot":""}

+ 1
- 1
dist/swagger-ui.css
Filskillnaden har hållits tillbaka eftersom den är för stor
Visa fil


+ 1
- 1
dist/swagger-ui.js
Filskillnaden har hållits tillbaka eftersom den är för stor
Visa fil


+ 1
- 1
dist/swagger-ui.js.map Visa fil

@@ -1 +1 @@
{"version":3,"file":"swagger-ui.js","sources":["webpack:///swagger-ui.js"],"mappings":"AAAA;;;;;;AA67eA","sourceRoot":""}
{"version":3,"file":"swagger-ui.js","sources":["webpack:///swagger-ui.js"],"mappings":"AAAA;;;;;;AAs9eA","sourceRoot":""}

+ 1
- 1
make-webpack-config.js Visa fil

@@ -137,7 +137,7 @@ module.exports = function(rules, options) {
}
},

devtool: specialOptions.sourcemaps ? "cheap-module-source-map" : null,
devtool: specialOptions.sourcemaps ? "nosource-source-map" : null,

plugins,



+ 2
- 2
package.json Visa fil

@@ -1,6 +1,6 @@
{
"name": "swagger-ui",
"version": "3.3.1",
"version": "3.3.2",
"main": "dist/swagger-ui.js",
"repository": "git@github.com:swagger-api/swagger-ui.git",
"contributors": [
@@ -78,7 +78,7 @@
"scroll-to-element": "^2.0.0",
"serialize-error": "2.0.0",
"shallowequal": "0.2.2",
"swagger-client": "^3.2.0",
"swagger-client": "^3.2.2",
"url-parse": "^1.1.8",
"whatwg-fetch": "0.11.1",
"worker-loader": "^0.7.1",


+ 1
- 0
src/core/components/providers/markdown.jsx Visa fil

@@ -31,6 +31,7 @@ export default Markdown
const sanitizeOptions = {
allowedTags: sanitize.defaults.allowedTags.concat([ "h1", "h2", "img" ]),
allowedAttributes: {
...sanitize.defaults.allowedAttributes,
"img": sanitize.defaults.allowedAttributes.img.concat(["title"])
},
textFilter: function(text) {


+ 3
- 3
src/core/plugins/auth/selectors.js Visa fil

@@ -10,7 +10,7 @@ export const shownDefinitions = createSelector(

export const definitionsToAuthorize = createSelector(
state,
() =>( { specSelectors } ) => {
() => ( { specSelectors } ) => {
let definitions = specSelectors.securityDefinitions()
let list = List()

@@ -27,7 +27,7 @@ export const definitionsToAuthorize = createSelector(
)


export const getDefinitionsByNames = ( state, securities ) =>( { specSelectors } ) => {
export const getDefinitionsByNames = ( state, securities ) => ( { specSelectors } ) => {
let securityDefinitions = specSelectors.securityDefinitions()
let result = List()

@@ -64,7 +64,7 @@ export const authorized = createSelector(
)


export const isAuthorized = ( state, securities ) =>( { authSelectors } ) => {
export const isAuthorized = ( state, securities ) => ( { authSelectors } ) => {
let authorized = authSelectors.authorized()

if(!List.isList(securities)) {


+ 2
- 2
src/core/plugins/oas3/auth-extensions/wrap-selectors.js Visa fil

@@ -6,7 +6,7 @@ import { isOAS3 as isOAS3Helper } from "../helpers"
// Helpers

function onlyOAS3(selector) {
return (ori, system) => (...args) => {
return (ori, system) => (state, ...args) => {
const spec = system.getSystem().specSelectors.specJson()
if(isOAS3Helper(spec)) {
return selector(...args)
@@ -20,7 +20,7 @@ const nullSelector = createSelector(() => null)

const OAS3NullSelector = onlyOAS3(nullSelector)

// Hasta la vista, authentication!
// Hasta la vista, authorization!
export const shownDefinitions = OAS3NullSelector
export const definitionsToAuthorize = OAS3NullSelector
export const getDefinitionsByNames = OAS3NullSelector


+ 5
- 2
src/core/plugins/spec/actions.js Visa fil

@@ -137,10 +137,13 @@ export function changeParam( path, paramName, paramIn, value, isXml ){
}
}

export function validateParams( payload ){
export const validateParams = ( payload, isOAS3 ) =>{
return {
type: VALIDATE_PARAMS,
payload:{ pathMethod: payload }
payload:{
pathMethod: payload,
isOAS3
}
}
}



+ 2
- 2
src/core/plugins/spec/reducers.js Visa fil

@@ -51,14 +51,14 @@ export default {
})
},

[VALIDATE_PARAMS]: ( state, { payload: { pathMethod } } ) => {
[VALIDATE_PARAMS]: ( state, { payload: { pathMethod, isOAS3 } } ) => {
let operation = state.getIn( [ "resolved", "paths", ...pathMethod ] )
let isXml = /xml/i.test(operation.get("consumes_value"))

return state.updateIn( [ "resolved", "paths", ...pathMethod, "parameters" ], fromJS([]), parameters => {
return parameters.withMutations( parameters => {
for ( let i = 0, len = parameters.count(); i < len; i++ ) {
let errors = validateParam(parameters.get(i), isXml)
let errors = validateParam(parameters.get(i), isXml, isOAS3)
parameters.setIn([i, "errors"], fromJS(errors))
}
})


+ 4
- 0
src/core/plugins/spec/wrap-actions.js Visa fil

@@ -13,3 +13,7 @@ export const executeRequest = (ori, { specActions }) => (req) => {
specActions.logRequest(req)
return ori(req)
}

export const validateParams = (ori, { specSelectors }) => (req) => {
return ori(req, specSelectors.isOAS3())
}

+ 10
- 8
src/core/utils.js Visa fil

@@ -537,16 +537,18 @@ export const validateMinLength = (val, min) => {
}

// validation of parameters before execute
export const validateParam = (param, isXml) => {
export const validateParam = (param, isXml, isOAS3 = false) => {
let errors = []
let value = isXml && param.get("in") === "body" ? param.get("value_xml") : param.get("value")
let required = param.get("required")
let maximum = param.get("maximum")
let minimum = param.get("minimum")
let type = param.get("type")
let format = param.get("format")
let maxLength = param.get("maxLength")
let minLength = param.get("minLength")

let paramDetails = isOAS3 ? param.get("schema") : param
let maximum = paramDetails.get("maximum")
let minimum = paramDetails.get("minimum")
let type = paramDetails.get("type")
let format = paramDetails.get("format")
let maxLength = paramDetails.get("maxLength")
let minLength = paramDetails.get("minLength")

/*
If the parameter is required OR the parameter has a value (meaning optional, but filled in)
@@ -616,7 +618,7 @@ export const validateParam = (param, isXml) => {

if ( !value.count() ) { return errors }

itemType = param.getIn(["items", "type"])
itemType = paramDetails.getIn(["items", "type"])

value.forEach((item, index) => {
let err


+ 0
- 8
src/style/_layout.scss Visa fil

@@ -772,14 +772,6 @@
}
}

.renderedMarkdown {
p {
@include text_body();
margin-top: 0px;
margin-bottom: 0px;
}
}

.response-content-type {
padding-top: 1em;



+ 6
- 0
test/components/markdown.js Visa fil

@@ -24,6 +24,12 @@ describe("Markdown component", function() {
const el = render(<Markdown source={str} />)
expect(el.html()).toEqual(`<div class="markdown"><h1>h1</h1>\n<h2>h2</h2>\n<h3>h3</h3>\n<h4>h4</h4>\n<h5>h5</h5>\n<h6>h6</h6>\n</div>`)
})

it("allows links", function() {
const str = `[Link](https://example.com/)`
const el = render(<Markdown source={str} />)
expect(el.html()).toEqual(`<div class="markdown"><p><a href="https://example.com/" target="_blank">Link</a></p>\n</div>`)
})
})

describe("OAS 3", function() {


+ 160
- 183
test/core/utils.js Visa fil

@@ -277,461 +277,438 @@ describe("utils", function() {
let param = null
let result = null

it("skips validation when `type` is not specified", function() {
// invalid type
const assertValidateParam = (param, expectedError) => {
// Swagger 2.0 version
result = validateParam( fromJS(param), false )
expect( result ).toEqual( expectedError )

// OAS3 version, using `schema` sub-object
let oas3Param = {
value: param.value,
required: param.required,
schema: {
...param,
value: undefined,
required: undefined
}
}
result = validateParam( fromJS(oas3Param), false, true )
expect( result ).toEqual( expectedError )
}

it("should check the isOAS3 flag when validating parameters", function() {
// This should "skip" validation because there is no `schema.type` property
// and we are telling `validateParam` this is an OAS3 spec
param = fromJS({
required: false,
type: undefined,
value: ""
value: "",
required: true,
schema: {
notTheTypeProperty: "string"
}
})
result = validateParam( param, false )
result = validateParam( param, false, true )
expect( result ).toEqual( [] )
})

it("validates required strings", function() {
// invalid string
param = fromJS({
param = {
required: true,
type: "string",
value: ""
})
result = validateParam( param, false )
expect( result ).toEqual( ["Required field is not provided"] )
}
assertValidateParam(param, ["Required field is not provided"])

// valid string
param = fromJS({
param = {
required: true,
type: "string",
value: "test string"
})
result = validateParam( param, false )
expect( result ).toEqual( [] )
}
assertValidateParam(param, [])

// valid string with min and max length
param = fromJS({
param = {
required: true,
type: "string",
value: "test string",
maxLength: 50,
minLength: 1
})
result = validateParam( param, false )
expect( result ).toEqual( [] )
}
assertValidateParam(param, [])
})

it("validates required strings with min and max length", function() {
// invalid string with max length
param = fromJS({
param = {
required: true,
type: "string",
value: "test string",
maxLength: 5
})
result = validateParam( param, false )
expect( result ).toEqual( ["Value must be less than MaxLength"] )
}
assertValidateParam(param, ["Value must be less than MaxLength"])

// invalid string with max length 0
param = fromJS({
param = {
required: true,
type: "string",
value: "test string",
maxLength: 0
})
result = validateParam( param, false )
expect( result ).toEqual( ["Value must be less than MaxLength"] )

}
assertValidateParam(param, ["Value must be less than MaxLength"])

// invalid string with min length
param = fromJS({
param = {
required: true,
type: "string",
value: "test string",
minLength: 50
})
result = validateParam( param, false )
expect( result ).toEqual( ["Value must be greater than MinLength"] )
}
assertValidateParam(param, ["Value must be greater than MinLength"])
})

it("validates optional strings", function() {
// valid (empty) string
param = fromJS({
param = {
required: false,
type: "string",
value: ""
})
result = validateParam( param, false )
expect( result ).toEqual( [] )
}
assertValidateParam(param, [])

// valid string
param = fromJS({
param = {
required: false,
type: "string",
value: "test"
})
result = validateParam( param, false )
expect( result ).toEqual( [] )
}
assertValidateParam(param, [])
})

it("validates required files", function() {
// invalid file
param = fromJS({
param = {
required: true,
type: "file",
value: undefined
})
result = validateParam( param, false )
expect( result ).toEqual( ["Required field is not provided"] )
}
assertValidateParam(param, ["Required field is not provided"])

// valid file
param = fromJS({
param = {
required: true,
type: "file",
value: new win.File()
})
result = validateParam( param, false )
expect( result ).toEqual( [] )
}
assertValidateParam(param, [])
})

it("validates optional files", function() {
// invalid file
param = fromJS({
param = {
required: false,
type: "file",
value: "not a file"
})
result = validateParam( param, false )
expect( result ).toEqual( ["Value must be a file"] )
}
assertValidateParam(param, ["Value must be a file"])

// valid (empty) file
param = fromJS({
param = {
required: false,
type: "file",
value: undefined
})
result = validateParam( param, false )
expect( result ).toEqual( [] )
}
assertValidateParam(param, [])

// valid file
param = fromJS({
param = {
required: false,
type: "file",
value: new win.File()
})
result = validateParam( param, false )
expect( result ).toEqual( [] )
}
assertValidateParam(param, [])
})

it("validates required arrays", function() {
// invalid (empty) array
param = fromJS({
param = {
required: true,
type: "array",
value: []
})
result = validateParam( param, false )
expect( result ).toEqual( ["Required field is not provided"] )
}
assertValidateParam(param, ["Required field is not provided"])

// invalid (not an array)
param = fromJS({
param = {
required: true,
type: "array",
value: undefined
})
result = validateParam( param, false )
expect( result ).toEqual( ["Required field is not provided"] )
}
assertValidateParam(param, ["Required field is not provided"])

// invalid array, items do not match correct type
param = fromJS({
param = {
required: true,
type: "array",
value: [1],
items: {
type: "string"
}
})
result = validateParam( param, false )
expect( result ).toEqual( [{index: 0, error: "Value must be a string"}] )
}
assertValidateParam(param, [{index: 0, error: "Value must be a string"}])

// valid array, with no 'type' for items
param = fromJS({
param = {
required: true,
type: "array",
value: ["1"]
})
result = validateParam( param, false )
expect( result ).toEqual( [] )
}
assertValidateParam(param, [])

// valid array, items match type
param = fromJS({
param = {
required: true,
type: "array",
value: ["1"],
items: {
type: "string"
}
})
result = validateParam( param, false )
expect( result ).toEqual( [] )
}
assertValidateParam(param, [])
})

it("validates optional arrays", function() {
// valid, empty array
param = fromJS({
param = {
required: false,
type: "array",
value: []
})
result = validateParam( param, false )
expect( result ).toEqual( [] )
}
assertValidateParam(param, [])

// invalid, items do not match correct type
param = fromJS({
param = {
required: false,
type: "array",
value: ["number"],
items: {
type: "number"
}
})
result = validateParam( param, false )
expect( result ).toEqual( [{index: 0, error: "Value must be a number"}] )
}
assertValidateParam(param, [{index: 0, error: "Value must be a number"}])

// valid
param = fromJS({
param = {
required: false,
type: "array",
value: ["test"],
items: {
type: "string"
}
})
result = validateParam( param, false )
expect( result ).toEqual( [] )
}
assertValidateParam(param, [])
})

it("validates required booleans", function() {
// invalid boolean value
param = fromJS({
param = {
required: true,
type: "boolean",
value: undefined
})
result = validateParam( param, false )
expect( result ).toEqual( ["Required field is not provided"] )
}
assertValidateParam(param, ["Required field is not provided"])

// invalid boolean value (not a boolean)
param = fromJS({
param = {
required: true,
type: "boolean",
value: "test string"
})
result = validateParam( param, false )
expect( result ).toEqual( ["Required field is not provided"] )
}
assertValidateParam(param, ["Required field is not provided"])

// valid boolean value
param = fromJS({
param = {
required: true,
type: "boolean",
value: "true"
})
result = validateParam( param, false )
expect( result ).toEqual( [] )
}
assertValidateParam(param, [])

// valid boolean value
param = fromJS({
param = {
required: true,
type: "boolean",
value: false
})
result = validateParam( param, false )
expect( result ).toEqual( [] )
}
assertValidateParam(param, [])
})

it("validates optional booleans", function() {
// valid (empty) boolean value
param = fromJS({
param = {
required: false,
type: "boolean",
value: undefined
})
result = validateParam( param, false )
expect( result ).toEqual( [] )
}
assertValidateParam(param, [])

// invalid boolean value (not a boolean)
param = fromJS({
param = {
required: false,
type: "boolean",
value: "test string"
})
result = validateParam( param, false )
expect( result ).toEqual( ["Value must be a boolean"] )
}
assertValidateParam(param, ["Value must be a boolean"])

// valid boolean value
param = fromJS({
param = {
required: false,
type: "boolean",
value: "true"
})
result = validateParam( param, false )
expect( result ).toEqual( [] )
}
assertValidateParam(param, [])

// valid boolean value
param = fromJS({
param = {
required: false,
type: "boolean",
value: false
})
result = validateParam( param, false )
expect( result ).toEqual( [] )
}
assertValidateParam(param, [])
})

it("validates required numbers", function() {
// invalid number, string instead of a number
param = fromJS({
param = {
required: true,
type: "number",
value: "test"
})
result = validateParam( param, false )
expect( result ).toEqual( ["Required field is not provided"] )
}
assertValidateParam(param, ["Required field is not provided"])

// invalid number, undefined value
param = fromJS({
param = {
required: true,
type: "number",
value: undefined
})
result = validateParam( param, false )
expect( result ).toEqual( ["Required field is not provided"] )
}
assertValidateParam(param, ["Required field is not provided"])

// valid number with min and max
param = fromJS({
param = {
required: true,
type: "number",
value: 10,
minimum: 5,
maximum: 99
})
result = validateParam( param, false )
expect( result ).toEqual( [] )
}
assertValidateParam(param, [])

// valid negative number with min and max
param = fromJS({
param = {
required: true,
type: "number",
value: -10,
minimum: -50,
maximum: -5
})
result = validateParam( param, false )
expect( result ).toEqual( [] )
}
assertValidateParam(param, [])

// invalid number with maximum:0
param = fromJS({
param = {
required: true,
type: "number",
value: 1,
maximum: 0
})
result = validateParam( param, false )
expect( result ).toEqual( ["Value must be less than Maximum"] )
}
assertValidateParam(param, ["Value must be less than Maximum"])

// invalid number with minimum:0
param = fromJS({
param = {
required: true,
type: "number",
value: -10,
minimum: 0
})
result = validateParam( param, false )
expect( result ).toEqual( ["Value must be greater than Minimum"] )
}
assertValidateParam(param, ["Value must be greater than Minimum"])
})

it("validates optional numbers", function() {
// invalid number, string instead of a number
param = fromJS({
param = {
required: false,
type: "number",
value: "test"
})
result = validateParam( param, false )
expect( result ).toEqual( ["Value must be a number"] )
}
assertValidateParam(param, ["Value must be a number"])

// valid (empty) number
param = fromJS({
param = {
required: false,
type: "number",
value: undefined
})
result = validateParam( param, false )
expect( result ).toEqual( [] )
}
assertValidateParam(param, [])

// valid number
param = fromJS({
param = {
required: false,
type: "number",
value: 10
})
result = validateParam( param, false )
expect( result ).toEqual( [] )
}
assertValidateParam(param, [])
})

it("validates required integers", function() {
// invalid integer, string instead of an integer
param = fromJS({
param = {
required: true,
type: "integer",
value: "test"
})
result = validateParam( param, false )
expect( result ).toEqual( ["Required field is not provided"] )
}
assertValidateParam(param, ["Required field is not provided"])

// invalid integer, undefined value
param = fromJS({
param = {
required: true,
type: "integer",
value: undefined
})
result = validateParam( param, false )
expect( result ).toEqual( ["Required field is not provided"] )
}
assertValidateParam(param, ["Required field is not provided"])

// valid integer
param = fromJS({
param = {
required: true,
type: "integer",
value: 10
})
result = validateParam( param, false )
expect( result ).toEqual( [] )
}
assertValidateParam(param, [])
})

it("validates optional integers", function() {
// invalid integer, string instead of an integer
param = fromJS({
param = {
required: false,
type: "integer",
value: "test"
})
result = validateParam( param, false )
expect( result ).toEqual( ["Value must be an integer"] )
}
assertValidateParam(param, ["Value must be an integer"])

// valid (empty) integer
param = fromJS({
param = {
required: false,
type: "integer",
value: undefined
})
result = validateParam( param, false )
expect( result ).toEqual( [] )
}
assertValidateParam(param, [])

// integers
param = fromJS({
param = {
required: false,
type: "integer",
value: 10
})
result = validateParam( param, false )
expect( result ).toEqual( [] )
}
assertValidateParam(param, [])
})
})



+ 1
- 1
webpack-dist-bundle.config.js Visa fil

@@ -11,7 +11,7 @@ let rules = [
name: "[name].js"
}
},
{ loader: "babel-loader" }
{ loader: "babel-loader?retainLines=true" }
]
}
]


+ 1
- 1
webpack-dist-standalone.config.js Visa fil

@@ -11,7 +11,7 @@ let rules = [
name: "[name].js"
}
},
{ loader: "babel-loader" }
{ loader: "babel-loader?retainLines=true" }
]
}
]


+ 1
- 1
webpack-dist.config.js Visa fil

@@ -13,7 +13,7 @@ let rules = [
name: "[name].js"
}
},
{ loader: "babel-loader" }
{ loader: "babel-loader?retainLines=true" }
]
}
]


+ 2
- 8
webpack-hot-dev-server.config.js Visa fil

@@ -9,13 +9,7 @@ const rules = [
inline: true
}
},
{ loader: "babel-loader" }
]
},
{ test: /\.(jsx)(\?.*)?$/,
use: [
{ loader: "react-hot-loader" },
{ loader: "babel-loader" }
{ loader: "babel-loader?retainLines=true" }
]
},
{ test: /\.(css)(\?.*)?$/,
@@ -48,7 +42,7 @@ module.exports = require("./make-webpack-config")(rules, {
_special: {
separateStylesheets: false,
},
devtool: "eval",
devtool: "eval-source-map",
entry: {
"swagger-ui-bundle": [
"./src/polyfills",


Laddar…
Avbryt
Spara