webpack.common.js 783 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. const path = require('path');
  2. const { CleanWebpackPlugin } = require('clean-webpack-plugin');
  3. const HtmlWebpackPlugin = require('html-webpack-plugin');
  4. module.exports = {
  5. entry: {
  6. component:{
  7. import:'./src/components/horizontal-resizer.ts',
  8. },
  9. index:{
  10. import:'./src/index.ts',
  11. dependOn:"Timeline"
  12. },
  13. Timeline:'./src/Timeline.ts',
  14. },
  15. plugins: [
  16. new CleanWebpackPlugin(),
  17. new HtmlWebpackPlugin({
  18. title: 'Development',
  19. }),
  20. ],
  21. module: {
  22. rules: [
  23. {
  24. test: /\.tsx?$/,
  25. use: 'ts-loader',
  26. exclude: /node_modules/,
  27. },
  28. ],
  29. },
  30. resolve: {
  31. extensions: [ '.tsx', '.ts', '.js' ],
  32. },
  33. output: {
  34. filename: '[name].bundle.js',
  35. path: path.resolve(__dirname, 'dist'),
  36. },
  37. };