Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

7 роки тому
7 роки тому
7 роки тому
7 роки тому
7 роки тому
7 роки тому
12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. const path = require("path")
  2. const fs = require("fs")
  3. const nodeModules = fs.readdirSync("node_modules").filter(function(x) { return x !== ".bin" })
  4. module.exports = require("./make-webpack-config.js")({
  5. _special: {
  6. separateStylesheets: true,
  7. minimize: true,
  8. sourcemaps: true,
  9. loaders: {
  10. "worker.js": ["worker-loader?inline=true&name=[name].js", "babel"]
  11. }
  12. },
  13. entry: {
  14. "swagger-ui": [
  15. "./src/style/main.scss",
  16. "./src/polyfills",
  17. "./src/core/index.js"
  18. ]
  19. },
  20. externals: function(context, request, cb) {
  21. // webpack injects some stuff into the resulting file,
  22. // these libs need to be pulled in to keep that working.
  23. var exceptionsForWebpack = ["ieee754", "base64-js"]
  24. if(nodeModules.indexOf(request) !== -1 || exceptionsForWebpack.indexOf(request) !== -1) {
  25. cb(null, "commonjs " + request)
  26. return
  27. }
  28. cb()
  29. },
  30. output: {
  31. path: path.join(__dirname, "dist"),
  32. publicPath: "/dist",
  33. library: "SwaggerUICore",
  34. libraryTarget: "umd",
  35. filename: "[name].js",
  36. chunkFilename: "js/[name].js",
  37. },
  38. })