webpack.config.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. const path = require("path");
  2. const MiniCssExtractPlugin = require("mini-css-extract-plugin");
  3. const babylonWebpackConfig = require('../Tools/WebpackPlugins/babylonWebpackConfig');
  4. var config = babylonWebpackConfig({
  5. module: "inspector",
  6. resolve: {
  7. extensions: [".js", '.ts', ".tsx"],
  8. alias: {
  9. "re-resizable$": __dirname + "/../node_modules/re-resizable/lib/index.es5.js"
  10. }
  11. },
  12. moduleRules: [
  13. {
  14. test: /\.scss$/,
  15. use: [
  16. // fallback to style-loader in development
  17. process.env.NODE_ENV !== 'production' ? 'style-loader' : MiniCssExtractPlugin.loader,
  18. "css-loader",
  19. "sass-loader"
  20. ]
  21. },
  22. {
  23. test: /\.css$/,
  24. use: ['style-loader', 'css-loader']
  25. },
  26. {
  27. test: /\.svg$/,
  28. use: [
  29. {
  30. loader: 'svg-url-loader',
  31. options: {
  32. limit: 10000,
  33. },
  34. },
  35. ],
  36. }
  37. ],
  38. plugins: [
  39. new MiniCssExtractPlugin({
  40. // Options similar to the same options in webpackOptions.output
  41. // both options are optional
  42. filename: "[name].css",
  43. chunkFilename: "[id].css"
  44. })
  45. ]
  46. });
  47. module.exports = config;