25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

46 lines
1.1 KiB

  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. 'babel-polyfill',
  16. './src/style/main.scss',
  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(node_modules.indexOf(request) !== -1 || exceptionsForWebpack.indexOf(request) !== -1) {
  25. console.log(request)
  26. cb(null, 'commonjs ' + request)
  27. return;
  28. }
  29. cb();
  30. },
  31. output: {
  32. path: path.join(__dirname, "dist"),
  33. publicPath: "/dist",
  34. library: "SwaggerUICore",
  35. libraryTarget: "umd",
  36. filename: "[name].js",
  37. chunkFilename: "js/[name].js",
  38. },
  39. })