webpack.config.js 1.1 KB

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