webpack.config.js 1.0 KB

1234567891011121314151617181920212223242526272829
  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. { test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/, use: 'url-loader?limit=10000&mimetype=application/font-woff' },
  21. { test: /\.woff(\?v=\d+\.\d+\.\d+)?$/, use: 'url-loader?limit=10000&mimetype=application/font-woff' },
  22. { test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, use: 'url-loader?limit=10000&mimetype=application/octet-stream' },
  23. { test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, use: 'file-loader' },
  24. { test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, use: 'url-loader?limit=10000&mimetype=image/svg+xml' }
  25. ],
  26. }
  27. };