webpack.config.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Copyright (c) Jupyter Development Team.
  2. // Distributed under the terms of the Modified BSD License.
  3. module.exports = {
  4. entry: ['whatwg-fetch', './index.js'],
  5. output: {
  6. path: __dirname + '/build',
  7. filename: 'bundle.js'
  8. },
  9. node: {
  10. fs: 'empty'
  11. },
  12. bail: true,
  13. devtool: 'cheap-source-map',
  14. mode: 'production',
  15. module: {
  16. rules: [
  17. { test: /\.css$/, use: ['style-loader', 'css-loader'] },
  18. { test: /\.html$/, use: 'file-loader' },
  19. { test: /\.md$/, use: 'raw-loader' },
  20. { test: /\.(jpg|png|gif)$/, use: 'file-loader' },
  21. { test: /\.js.map$/, use: 'file-loader' },
  22. {
  23. test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/,
  24. use: 'url-loader?limit=10000&mimetype=application/font-woff'
  25. },
  26. {
  27. test: /\.woff(\?v=\d+\.\d+\.\d+)?$/,
  28. use: 'url-loader?limit=10000&mimetype=application/font-woff'
  29. },
  30. {
  31. test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,
  32. use: 'url-loader?limit=10000&mimetype=application/octet-stream'
  33. },
  34. { test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, use: 'file-loader' },
  35. {
  36. test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
  37. use: 'url-loader?limit=10000&mimetype=image/svg+xml'
  38. }
  39. ]
  40. }
  41. };