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

91 lines
2.7 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. // webpack.config.ts
  2. // Copyright (C) 2020 Dwayne Harris
  3. // This program is free software: you can redistribute it and/or modify
  4. // it under the terms of the GNU General Public License as published by
  5. // the Free Software Foundation, either version 3 of the License, or
  6. // (at your option) any later version.
  7. // This program is distributed in the hope that it will be useful,
  8. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. // GNU General Public License for more details.
  11. // You should have received a copy of the GNU General Public License
  12. // along with this program. If not, see <https://www.gnu.org/licenses/>.
  13. import { resolve } from 'path'
  14. import { Configuration } from 'webpack'
  15. import HtmlWebpackPlugin from 'html-webpack-plugin'
  16. import MiniCssExtractPlugin from 'mini-css-extract-plugin'
  17. import postcssNormalize from 'postcss-normalize'
  18. import postcssPresetEnv from 'postcss-preset-env'
  19. const config: Configuration = {
  20. mode: 'development',
  21. devtool: 'eval-source-map',
  22. entry: {
  23. app: resolve(__dirname, './index.tsx'),
  24. },
  25. output: {
  26. path: resolve(__dirname, '../../../../dist/apps/gif-app/'),
  27. filename: '[name].js',
  28. },
  29. optimization: {
  30. splitChunks: {
  31. chunks: 'all',
  32. },
  33. },
  34. resolve: {
  35. extensions: ['.ts', '.tsx', '.js', '.png'],
  36. },
  37. module: {
  38. rules: [
  39. {
  40. test: /\.ts(x?)$/,
  41. exclude: /node_modules/,
  42. use: 'ts-loader',
  43. },
  44. {
  45. test: /\.css$/,
  46. use: [
  47. MiniCssExtractPlugin.loader,
  48. {
  49. loader: 'css-loader',
  50. options: {
  51. importLoaders: 1,
  52. },
  53. },
  54. {
  55. loader: 'postcss-loader',
  56. options: {
  57. plugins: [
  58. postcssNormalize(),
  59. postcssPresetEnv({
  60. stage: 2,
  61. }),
  62. ]
  63. }
  64. }
  65. ],
  66. },
  67. {
  68. test: /\.(jpe?g|gif|png|svg)$/,
  69. use: ['file-loader'],
  70. },
  71. ],
  72. },
  73. plugins: [
  74. new HtmlWebpackPlugin({
  75. title: 'GIF App',
  76. hash: true,
  77. template: resolve(__dirname, './index.ejs'),
  78. filename: 'composer.html',
  79. }),
  80. new MiniCssExtractPlugin({
  81. filename: '[name].css',
  82. }),
  83. ],
  84. }
  85. export default config