webpack.config.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. const path = require('path');
  2. module.exports = [{
  3. //mode: "development",
  4. mode: "production",
  5. entry: {
  6. 'RcsbFv3D':'./src/RcsbFv3DBuilder.tsx',
  7. 'rcsb-saguaro-3d':'./src/RcsbSaguaro3D.js'
  8. },
  9. module: {
  10. rules: [
  11. {
  12. test: /\.tsx?$/,
  13. loader: 'ts-loader',
  14. exclude: /node_modules/
  15. },{
  16. test: /\.jsx?$/,
  17. loader: 'babel-loader',
  18. exclude: [/node_modules/]
  19. },{
  20. test: /\.scss$/,
  21. use: [
  22. 'style-loader',
  23. {
  24. loader: 'css-loader',
  25. options: {
  26. modules: {
  27. localIdentName:'[local]'
  28. }
  29. }
  30. },
  31. 'sass-loader'
  32. ]
  33. }
  34. ]
  35. },
  36. resolve: {
  37. extensions: [ '.tsx', '.ts', '.js', 'jsx' ]
  38. },
  39. node: {
  40. fs: "empty"
  41. },
  42. output: {
  43. filename: '[name].js',
  44. library: 'RcsbFv3D',
  45. libraryTarget: 'umd',
  46. umdNamedDefine: true,
  47. path: path.resolve(__dirname, 'dist')
  48. },
  49. devtool: 'source-map',
  50. }];