Aucune description

webpack.config.demo.prod.js 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. const path = require('path');
  2. const ExtractTextPlugin = require('extract-text-webpack-plugin');
  3. module.exports = {
  4. mode: "production",
  5. entry: [
  6. './demo/client.tsx'
  7. ],
  8. output: {
  9. filename: 'bundle-prod.js',
  10. path: path.resolve(__dirname, 'docs'),
  11. publicPath: '/react-mde/'
  12. },
  13. resolve: {
  14. extensions: ['.ts', '.tsx', '.js', '.jsx', '.css', '.scss', '.json']
  15. },
  16. module: {
  17. rules: [
  18. {
  19. test: /\.ts(x?)/,
  20. use: {
  21. loader: 'awesome-typescript-loader',
  22. options: {
  23. configFileName: "tsconfig.demo.prod.json"
  24. },
  25. },
  26. exclude: /node_modules/,
  27. },
  28. {test: /\.css/, use: ExtractTextPlugin.extract({use: "css-loader"})},
  29. {
  30. test: /\.scss/,
  31. use: ExtractTextPlugin.extract({use: ["css-loader", "sass-loader"]})
  32. },
  33. {test: /\.jpe?g$|\.gif$|\.png$|\.ico$/, use: 'file-loader?name=[name].[ext]'},
  34. {test: /\.eot|\.ttf|\.svg|\.woff2?/, use: 'file-loader?name=[name].[ext]'},
  35. ]
  36. },
  37. plugins: [
  38. new ExtractTextPlugin("bundle.css"),
  39. ]
  40. };