webpack.config.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. var path = require('path');
  2. var webpack = require('webpack');
  3. module.exports = {
  4. // entry: [
  5. // './src/OSMD/OSMD.ts'
  6. // // TODO: Add demo.js where the webdev server is implemented
  7. // //
  8. // ],
  9. entry: {
  10. 'osmd': './src/OSMD/OSMD.ts',
  11. 'demo': './demo/demo.js'
  12. },
  13. output: {
  14. path: path.resolve(__dirname, 'build'),
  15. filename: '[name].js',
  16. },
  17. resolve: {
  18. // Add '.ts' and '.tsx' as a resolvable extension.
  19. extensions: ['.webpack.js', '.web.js', '.ts', '.tsx', '.js']
  20. },
  21. module: {
  22. loaders: [
  23. // all files with a '.ts' or '.tsx' extension will be handled by 'ts-loader'
  24. { test: /\.tsx?$/, loader: 'ts-loader' }
  25. ]
  26. },
  27. plugins: [
  28. // build optimization plugins
  29. new webpack.LoaderOptionsPlugin({
  30. minimize: true,
  31. debug: false
  32. }),
  33. new webpack.optimize.UglifyJsPlugin({
  34. warnings: false,
  35. beautify: false,
  36. compress: true,
  37. comments: false,
  38. sourceMap: true
  39. })
  40. ],
  41. devServer: {
  42. contentBase: [
  43. path.join(__dirname, 'test/data'),
  44. path.join(__dirname, 'demo')
  45. // TODO: fill in paths for demo data
  46. ],
  47. port: 8000,
  48. compress: false,
  49. },
  50. };