webpack.config.js 1.3 KB

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