webpack.config.js 1.3 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: "nodeEditor",
  6. resolve: {
  7. extensions: [".js", '.ts', ".tsx"],
  8. },
  9. moduleRules: [
  10. {
  11. test: /\.scss$/,
  12. use: [
  13. // fallback to style-loader in development
  14. process.env.NODE_ENV !== 'production' ? 'style-loader' : MiniCssExtractPlugin.loader,
  15. "css-loader",
  16. "sass-loader"
  17. ]
  18. },
  19. {
  20. test: /\.css$/,
  21. use: ['style-loader', 'css-loader']
  22. },
  23. // {
  24. // test: /\.svg$/,
  25. // loader: 'svg-inline-loader'
  26. // },
  27. {
  28. test: /\.svg$/,
  29. use: [
  30. {
  31. loader: 'svg-url-loader',
  32. options: {
  33. limit: 10000,
  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;