From c2a7a8938138c50fa34e92ea7604db1cd9e4592d Mon Sep 17 00:00:00 2001 From: Gaetan Craig-Riou Date: Tue, 16 Dec 2025 11:45:33 +1100 Subject: [PATCH] Move extensions configuration to webpack.config.js --- config/webpack/webpack.config.js | 10 ++++++++++ config/webpacker.yml | 18 ------------------ 2 files changed, 10 insertions(+), 18 deletions(-) create mode 100644 config/webpack/webpack.config.js diff --git a/config/webpack/webpack.config.js b/config/webpack/webpack.config.js new file mode 100644 index 0000000000..db02af6d77 --- /dev/null +++ b/config/webpack/webpack.config.js @@ -0,0 +1,10 @@ +const { generateWebpackConfig } = require("@rails/webpacker") + +const options = { + resolve: { + extensions: [".mjs", ".js", ".sass",".scss", ".css", ".module.sass", ".module.scss", ".module.css", ".png", ".svg", ".gif", ".jpeg", ".jpg", ".eot", ".ttf", ".woff"] + } +} + +// This results in a new object copied from the mutable global +module.exports = generateWebpackConfig(options) diff --git a/config/webpacker.yml b/config/webpacker.yml index 6242775ead..7c9691e7b9 100644 --- a/config/webpacker.yml +++ b/config/webpacker.yml @@ -39,24 +39,6 @@ default: &default - .woff - .woff2 - extensions: - - .mjs - - .js - - .sass - - .scss - - .css - - .module.sass - - .module.scss - - .module.css - - .png - - .svg - - .gif - - .jpeg - - .jpg - - .eot - - .ttf - - .woff - development: <<: *default compile: true