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.
 
 
 
 

41 lines
862 B

  1. var path = require('path')
  2. var fs = require('fs')
  3. var node_modules = 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. if(node_modules.indexOf(request) !== -1) {
  21. cb(null, 'commonjs ' + request)
  22. return;
  23. }
  24. cb();
  25. },
  26. output: {
  27. path: path.join(__dirname, "dist"),
  28. publicPath: "/dist",
  29. library: "SwaggerUICore",
  30. libraryTarget: "umd",
  31. filename: "[name].js",
  32. chunkFilename: "js/[name].js",
  33. },
  34. })