webpack.config.js 766 B

123456789101112131415161718192021222324252627282930313233
  1. // Copyright 2017-2020 @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. module: {
  12. rules: [
  13. {
  14. exclude: /(node_modules)/,
  15. test: /\.(js|ts|tsx)$/,
  16. use: {
  17. loader: 'babel-loader'
  18. }
  19. }
  20. ]
  21. },
  22. output: {
  23. filename: './demo.js',
  24. path: __dirname
  25. },
  26. plugins: [],
  27. resolve: {
  28. alias: {},
  29. extensions: ['.js', '.jsx', '.ts', '.tsx']
  30. }
  31. };