webpack.config.js 1.3 KB

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