webpack.config.js 840 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. const path = require('path');
  2. const merge = require('deepmerge');
  3. const baseConfig = require('../base-webpack.config');
  4. const config = merge(baseConfig, {
  5. context: __dirname,
  6. entry: './main.jsx',
  7. output: {
  8. path: path.resolve(__dirname, 'build')
  9. },
  10. module: {
  11. rules: [
  12. {
  13. test: /\.jsx$/,
  14. loader: 'babel-loader',
  15. options: {
  16. presets: ['react', 'es2015'],
  17. plugins: ['transform-object-rest-spread']
  18. }
  19. },
  20. {
  21. test: /\.svg$/,
  22. loader: 'svg-sprite-loader',
  23. options: {
  24. runtimeGenerator: require.resolve('./svg-to-icon-component-runtime-generator'),
  25. runtimeOptions: {
  26. iconModule: './icon.jsx' // Relative to current build context folder
  27. }
  28. }
  29. }
  30. ]
  31. }
  32. });
  33. module.exports = config;