Skip to content

Commit 7d7353c

Browse files
authored
Merge pull request #1365 from swagger-api/feature/export-plugins
Export plugins and remove dead file
2 parents 4a0e27d + 0ae524c commit 7d7353c

11 files changed

+87
-129
lines changed

.agignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist/

dist/swagger-editor-bundle.js

Lines changed: 61 additions & 90 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/swagger-editor-bundle.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/swagger-editor-standalone-preset.js

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/swagger-editor-standalone-preset.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/swagger-editor.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/swagger-editor.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/swagger-editor.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"serve-static": "http-server -i -a 0.0.0.0 -p 3001",
3838
"prestart": "npm install",
3939
"start": "npm-run-all --parallel serve-static open-static",
40-
"watch": "webpack --config webpack.config.js --watch --progress"
40+
"watch": "webpack --config ./webpack-dist.config.js --watch --progress"
4141
},
4242
"dependencies": {
4343
"boron": "^0.2.3",

src/index.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,19 @@ const { GIT_DIRTY, GIT_COMMIT, PACKAGE_VERSION } = buildInfo
1212

1313
window.versions = window.versions || {}
1414
window.versions.swaggerEditor = `${PACKAGE_VERSION}/${GIT_COMMIT || "unknown"}${GIT_DIRTY ? "-dirty" : ""}`
15+
const plugins = {
16+
EditorPlugin,
17+
ValidationApiPlugin,
18+
LocalStoragePlugin
19+
}
1520

1621
const defaults = {
1722
dom_id: "#swagger-editor",
1823
layout: "EditorLayout",
1924
presets: [
2025
SwaggerUI.presets.apis
2126
],
22-
plugins: [
23-
EditorPlugin,
24-
ValidationApiPlugin,
25-
LocalStoragePlugin
26-
],
27+
plugins: Object.values(plugins),
2728
components: {
2829
EditorLayout
2930
},
@@ -36,3 +37,5 @@ module.exports = function SwaggerEditor(options) {
3637
mergedOptions.plugins = defaults.plugins.concat(options.plugins || [])
3738
return SwaggerUI(mergedOptions)
3839
}
40+
41+
module.exports.plugins = plugins

0 commit comments

Comments
 (0)