[ABANDONDED] Set of "apps" for the Flexor social network.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
2.0 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. import { resolve } from 'path'
  2. import { Configuration } from 'webpack'
  3. import HtmlWebpackPlugin from 'html-webpack-plugin'
  4. import MiniCssExtractPlugin from 'mini-css-extract-plugin'
  5. import postcssPresetEnv from 'postcss-preset-env'
  6. const config: Configuration = {
  7. mode: 'development',
  8. devtool: 'eval-source-map',
  9. entry: {
  10. app: resolve(__dirname, './index.tsx'),
  11. },
  12. output: {
  13. path: resolve(__dirname, '../../../../dist/apps/gif-app/'),
  14. filename: '[name].js',
  15. },
  16. optimization: {
  17. splitChunks: {
  18. chunks: 'all',
  19. },
  20. },
  21. resolve: {
  22. extensions: ['.ts', '.tsx', '.js', '.png'],
  23. },
  24. module: {
  25. rules: [
  26. {
  27. test: /\.ts(x?)$/,
  28. exclude: /node_modules/,
  29. use: 'ts-loader',
  30. },
  31. {
  32. test: /\.css$/,
  33. use: [
  34. MiniCssExtractPlugin.loader,
  35. {
  36. loader: 'css-loader',
  37. options: {
  38. importLoaders: 1,
  39. },
  40. },
  41. {
  42. loader: 'postcss-loader',
  43. options: {
  44. plugins: [
  45. postcssPresetEnv({
  46. stage: 2,
  47. }),
  48. ]
  49. }
  50. }
  51. ],
  52. },
  53. {
  54. test: /\.(jpe?g|gif|png|svg)$/,
  55. use: ['file-loader'],
  56. },
  57. ],
  58. },
  59. plugins: [
  60. new HtmlWebpackPlugin({
  61. title: 'GIF App',
  62. hash: true,
  63. template: resolve(__dirname, './index.ejs'),
  64. filename: 'composer.html',
  65. }),
  66. new MiniCssExtractPlugin({
  67. filename: '[name].css',
  68. }),
  69. ],
  70. }
  71. export default config