webpack.config.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. symlinks: false,
  8. extensions: [".js", '.ts', ".tsx"],
  9. alias: {
  10. "re-resizable$": __dirname + "/../node_modules/re-resizable/lib/index.es5.js"
  11. }
  12. },
  13. moduleRules: [
  14. {
  15. test: /\.scss$/,
  16. use: [
  17. // fallback to style-loader in development
  18. process.env.NODE_ENV !== 'production' ? 'style-loader' : MiniCssExtractPlugin.loader,
  19. "css-loader",
  20. "sass-loader"
  21. ]
  22. },
  23. {
  24. test: /\.css$/,
  25. use: ['style-loader', 'css-loader']
  26. },
  27. {
  28. test: /\.svg$/,
  29. use: [
  30. {
  31. loader: 'svg-url-loader',
  32. options: {
  33. limit: 10000,
  34. },
  35. },
  36. ],
  37. }
  38. ],
  39. plugins: [
  40. new MiniCssExtractPlugin({
  41. // Options similar to the same options in webpackOptions.output
  42. // both options are optional
  43. filename: "[name].css",
  44. chunkFilename: "[id].css"
  45. })
  46. ]
  47. });
  48. module.exports = config;