webpack.config.js 766 B

123456789101112131415161718192021222324252627282930313233
  1. // Copyright 2017-2019 @polkadot/react-query authors & contributors
  2. // This software may be modified and distributed under the terms
  3. // of the Apache-2.0 license. See the LICENSE file for details.
  4. const ENV = process.env.NODE_ENV || 'development';
  5. const isProd = ENV === 'production';
  6. module.exports = {
  7. context: __dirname,
  8. devtool: isProd ? 'source-map' : 'cheap-eval-source-map',
  9. entry: './src/demo.tsx',
  10. mode: ENV,
  11. output: {
  12. path: __dirname,
  13. filename: './demo.js'
  14. },
  15. resolve: {
  16. alias: {},
  17. extensions: ['.js', '.jsx', '.ts', '.tsx']
  18. },
  19. module: {
  20. rules: [
  21. {
  22. test: /\.(js|ts|tsx)$/,
  23. exclude: /(node_modules)/,
  24. use: {
  25. loader: 'babel-loader'
  26. }
  27. }
  28. ]
  29. },
  30. plugins: []
  31. };