mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 14:31:03 +08:00
DEV: Remove dependence on dartsass-sprockets (#23665)
Discourse has a custom stylesheet pipeline which compiles things 'just in time'. The only place we were still running sass files through sprockets was for the `/tests` route in development mode. This use can be removed by compiling the relevant stylesheets through ember-cli instead (which we were already doing for testem runs) This work was prompted by the incompatibility of dartsass-sprockets with the latest sass-embedded release (https://github.com/tablecheck/dartsass-sprockets/issues/13)
This commit is contained in:
@ -181,6 +181,15 @@ module Discourse
|
||||
charset: :unicode
|
||||
Sprockets.register_postprocessor "application/javascript", DiscourseJsProcessor
|
||||
|
||||
class SprocketsSassUnsupported
|
||||
def self.call(*args)
|
||||
raise "Discourse does not support compiling scss/sass files via Sprockets"
|
||||
end
|
||||
end
|
||||
|
||||
Sprockets.register_engine(".sass", SprocketsSassUnsupported, silence_deprecation: true)
|
||||
Sprockets.register_engine(".scss", SprocketsSassUnsupported, silence_deprecation: true)
|
||||
|
||||
Discourse::Application.initializer :prepend_ember_assets do |app|
|
||||
# Needs to be in its own initializer so it runs after the append_assets_path initializer defined by Sprockets
|
||||
app
|
||||
|
Reference in New Issue
Block a user