Skip to content

Commit 9f10ab1

Browse files
authored
housekeeping: cypress standalone failures (via #5446)
* webpack.dist-style.config.js -> webpack-dist-style.config.js * correctly generate stylesheets in dev server * attempt to recover from missing StandalonePlugin in Cypress runner
1 parent 21bb452 commit 9f10ab1

File tree

6 files changed

+10
-31
lines changed

6 files changed

+10
-31
lines changed

test/e2e-cypress/static/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
plugins: [
5050
SwaggerUIBundle.plugins.DownloadUrl
5151
],
52-
layout: "StandaloneLayout",
52+
layout: SwaggerUIStandalonePreset ? "StandaloneLayout" : "BaseLayout",
5353
onComplete: () => {
5454
if(window.completeCount) {
5555
window.completeCount++

webpack-dist-bundle.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const path = require("path")
2-
const styleRules = require("./webpack.dist-style.config.js")
2+
const styleRules = require("./webpack-dist-style.config.js")
33

44
let rules = [
55
{ test: /\.(worker\.js)(\?.*)?$/,

webpack-dist-standalone.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const path = require("path")
2-
const styleRules = require("./webpack.dist-style.config.js")
2+
const styleRules = require("./webpack-dist-style.config.js")
33

44
let rules = [
55
{ test: /\.(worker\.js)(\?.*)?$/,
File renamed without changes.

webpack-dist.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const path = require("path")
22
const fs = require("fs")
33
const nodeModules = fs.readdirSync("node_modules").filter(function(x) { return x !== ".bin" })
4-
const styleRules = require("./webpack.dist-style.config.js")
4+
const styleRules = require("./webpack-dist-style.config.js")
55

66
let rules = [
77
{ test: /\.(worker\.js)(\?.*)?$/,

webpack-hot-dev-server.config.js

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const path = require("path")
1+
const styleRules = require("./webpack-dist-style.config.js")
22

33
const rules = [
44
{ test: /\.(worker\.js)(\?.*)?$/,
@@ -12,44 +12,23 @@ const rules = [
1212
{ loader: "babel-loader?retainLines=true" }
1313
]
1414
},
15-
{ test: /\.(css)(\?.*)?$/,
16-
use: [
17-
"style-loader",
18-
"css-loader",
19-
"postcss-loader"
20-
]
21-
},
22-
{ test: /\.(scss)(\?.*)?$/,
23-
use: [
24-
"style-loader",
25-
"css-loader",
26-
{
27-
loader: "postcss-loader",
28-
options: { sourceMap: true }
29-
},
30-
{ loader: "sass-loader",
31-
options: {
32-
outputStyle: "expanded",
33-
sourceMap: true,
34-
sourceMapContents: "true"
35-
}
36-
}
37-
]
38-
}
15+
...styleRules
3916
]
4017

4118
module.exports = require("./make-webpack-config")(rules, {
4219
_special: {
43-
separateStylesheets: false,
20+
separateStylesheets: true,
4421
sourcemaps: true,
4522
},
4623
entry: {
24+
"swagger-ui": [
25+
"./src/style/main.scss"
26+
],
4727
"swagger-ui-bundle": [
4828
"./src/polyfills",
4929
"./src/core/index.js"
5030
],
5131
"swagger-ui-standalone-preset": [
52-
"./src/style/main.scss",
5332
"./src/polyfills",
5433
"./src/standalone/index.js",
5534
]

0 commit comments

Comments
 (0)