Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

webpack-dist.config.js 862 B

7 år sedan
12345678910111213141516171819202122232425262728293031323334353637383940
  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. })