webpack.config.js 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. module.exports = {
  2. entry: ['whatwg-fetch', './build/index.js'],
  3. output: {
  4. path: __dirname + '/build',
  5. filename: 'bundle.js',
  6. publicPath: './example/'
  7. },
  8. bail: true,
  9. devtool: 'source-map',
  10. module: {
  11. rules: [
  12. { test: /\.css$/, use: ['style-loader', 'css-loader'] },
  13. { test: /\.html$/, use: 'file-loader' },
  14. // jquery-ui loads some images
  15. { test: /\.(jpg|png|gif)$/, use: 'file-loader' },
  16. // required to load font-awesome
  17. {
  18. test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/,
  19. use: 'url-loader?limit=10000&mimetype=application/font-woff'
  20. },
  21. {
  22. test: /\.woff(\?v=\d+\.\d+\.\d+)?$/,
  23. use: 'url-loader?limit=10000&mimetype=application/font-woff'
  24. },
  25. {
  26. test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,
  27. use: 'url-loader?limit=10000&mimetype=application/octet-stream'
  28. },
  29. { test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, use: 'file-loader' },
  30. {
  31. test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
  32. use: 'url-loader?limit=10000&mimetype=image/svg+xml'
  33. }
  34. ]
  35. }
  36. };