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.

webpack-dist.config.js 886 B

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