webpack.tm-saguaro.config.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. const path = require('path');
  2. const commonConfig = {
  3. mode: "production",
  4. module: {
  5. rules: [
  6. {
  7. test: /\.(html|ico)$/,
  8. use: [{
  9. loader: 'file-loader',
  10. options: { name: '[name].[ext]' }
  11. }]
  12. },{
  13. test: /\.scss$/,
  14. use: [
  15. 'style-loader',
  16. {
  17. loader: 'css-loader',
  18. options: {
  19. modules: {
  20. localIdentName:'[local]'
  21. }
  22. }
  23. },
  24. 'sass-loader'
  25. ]
  26. }
  27. ]
  28. },
  29. resolve: {
  30. modules: [
  31. 'node_modules',
  32. path.resolve(__dirname, 'build/src/')
  33. ],
  34. fallback: {
  35. fs: false,
  36. buffer: require.resolve('buffer'),
  37. crypto: require.resolve('crypto-browserify'),
  38. path: require.resolve('path-browserify'),
  39. stream: require.resolve('stream-browserify')
  40. }
  41. }
  42. };
  43. const out_path = "build/TmFeatureViewer";
  44. const examples = [];
  45. examples.push({
  46. ...commonConfig,
  47. entry: {
  48. "tm-saguaro": './lib/TmFv3DApp/index.js'
  49. },
  50. output: {
  51. filename: '[name].js',
  52. path: path.resolve(__dirname, out_path),
  53. library: {
  54. name: 'tmSaguaro',
  55. type: 'umd'
  56. }
  57. }
  58. });
  59. module.exports = examples;