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

71 lines
1.9 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/text-app/'),
  15. filename: '[name].js',
  16. },
  17. optimization: {
  18. splitChunks: {
  19. chunks: 'all',
  20. },
  21. },
  22. resolve: {
  23. extensions: ['.ts', '.tsx', '.js'],
  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. },
  57. plugins: [
  58. new HtmlWebpackPlugin({
  59. title: 'Text App',
  60. hash: true,
  61. template: resolve(__dirname, './index.ejs'),
  62. filename: 'composer.html',
  63. }),
  64. new MiniCssExtractPlugin({
  65. filename: '[name].css',
  66. }),
  67. ],
  68. }
  69. export default config