webpack.config.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. var path = require('path');
  2. var webpack = require('webpack');
  3. var PACKAGE = require('./package.json');
  4. var banner = '\n ' + PACKAGE.name + ' - v' + PACKAGE.version + ' (' + PACKAGE.homepage +') ' +
  5. '\n ' + PACKAGE.description + '\n ' +
  6. '\n ' + PACKAGE.license +
  7. '\n (c) ' + new Date().getFullYear() + ' ' + PACKAGE.author + '\n';
  8. var pluginFiles = [
  9. './src/leaflet.motion.js',
  10. './src/leaflet.motion.utils.js',
  11. './src/leaflet.motion.easing.js',
  12. './src/layer/leaflet.motion.polyline.js',
  13. './src/layer/leaflet.motion.polygon.js',
  14. './src/layer/leaflet.motion.group.js',
  15. './src/layer/leaflet.motion.seq.js'
  16. ];
  17. module.exports = [
  18. {
  19. mode: "development",
  20. entry: {
  21. "leaflet.motion": pluginFiles,
  22. },
  23. output: { filename: '[name].js', path: path.resolve(__dirname, 'dist') },
  24. plugins: [
  25. new webpack.BannerPlugin(banner)
  26. ]
  27. },
  28. {
  29. mode: "production",
  30. entry: {
  31. "leaflet.motion.min": pluginFiles,
  32. },
  33. output: { filename: '[name].js', path: path.resolve(__dirname, 'dist') },
  34. plugins: [
  35. new webpack.BannerPlugin(banner)
  36. ]
  37. }
  38. ];