[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.

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