webpack.config.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  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: /\.json$/, use: 'json-loader' },
  22. { test: /\.html$/, use: 'file-loader' },
  23. { test: /\.md$/, use: 'raw-loader' },
  24. { test: /\.(jpg|png|gif)$/, use: 'file-loader' },
  25. { test: /\.js.map$/, use: 'file-loader' },
  26. { test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/, use: 'url-loader?limit=10000&mimetype=application/font-woff' },
  27. { test: /\.woff(\?v=\d+\.\d+\.\d+)?$/, use: 'url-loader?limit=10000&mimetype=application/font-woff' },
  28. { test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, use: 'url-loader?limit=10000&mimetype=application/octet-stream' },
  29. { test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, use: 'file-loader' },
  30. { test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, use: 'url-loader?limit=10000&mimetype=image/svg+xml' }
  31. ],
  32. }
  33. };