webpack.config.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  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: 'cheap-source-map',
  10. mode: 'production',
  11. module: {
  12. rules: [
  13. { test: /\.css$/, use: ['style-loader', 'css-loader'] },
  14. { test: /\.html$/, use: 'file-loader' },
  15. { test: /\.md$/, use: 'raw-loader' },
  16. { test: /\.(jpg|png|gif)$/, use: 'file-loader' },
  17. { test: /\.js.map$/, use: 'file-loader' },
  18. {
  19. test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/,
  20. use: 'url-loader?limit=10000&mimetype=application/font-woff'
  21. },
  22. {
  23. test: /\.woff(\?v=\d+\.\d+\.\d+)?$/,
  24. use: 'url-loader?limit=10000&mimetype=application/font-woff'
  25. },
  26. {
  27. test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,
  28. use: 'url-loader?limit=10000&mimetype=application/octet-stream'
  29. },
  30. { test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, use: 'file-loader' },
  31. {
  32. test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
  33. use: 'url-loader?limit=10000&mimetype=image/svg+xml'
  34. }
  35. ]
  36. }
  37. };