You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

43 lines
1.1 KiB

  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/core/index.js"
  17. ]
  18. },
  19. externals: function(context, request, cb) {
  20. // webpack injects some stuff into the resulting file,
  21. // these libs need to be pulled in to keep that working.
  22. var exceptionsForWebpack = ["ieee754", "base64-js"]
  23. if(nodeModules.indexOf(request) !== -1 || exceptionsForWebpack.indexOf(request) !== -1) {
  24. cb(null, "commonjs " + request)
  25. return
  26. }
  27. cb()
  28. },
  29. output: {
  30. path: path.join(__dirname, "dist"),
  31. publicPath: "/dist",
  32. library: "SwaggerUICore",
  33. libraryTarget: "umd",
  34. filename: "[name].js",
  35. chunkFilename: "js/[name].js",
  36. },
  37. })