File tree Expand file tree Collapse file tree 2 files changed +13
-18
lines changed
Expand file tree Collapse file tree 2 files changed +13
-18
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,17 @@ protected function _processContent()
6464 {
6565 $ this ->_minify ();
6666 }
67+
68+ if ($ this ->getOption ('sourcemap ' , false ))
69+ {
70+ $ map = $ this ->_filePath . '.map ' ;
71+ if (file_exists ($ map ))
72+ {
73+ $ this ->_content .= '/*# sourceMappingURL=data:application/json;charset=utf8;base64, '
74+ . base64_encode (file_get_contents ($ map ))
75+ . '*/ ' ;
76+ }
77+ }
6778 }
6879
6980 protected function _minify () { }
Original file line number Diff line number Diff line change 66class CssResource extends AbstractDispatchableResource
77{
88 protected $ _options = [
9- 'minify ' => true ,
10- 'dispatch ' => true ,
11- 'sourcemap ' => false ,
9+ 'minify ' => true ,
10+ 'dispatch ' => true ,
1211 ];
1312
1413 public function getExtension ()
@@ -66,19 +65,4 @@ protected function _minify()
6665 $ this ->_content = trim ($ this ->_content );
6766 }
6867
69- protected function _processContent ()
70- {
71- parent ::_processContent ();
72- if ($ this ->getOption ('sourcemap ' , false ))
73- {
74- $ map = $ this ->_filePath . '.map ' ;
75- if (file_exists ($ map ))
76- {
77- $ this ->_content .= '/*# //@ sourceMappingURL=data:application/json;charset=utf-8;base64, '
78- . base64_encode (file_get_contents ($ map ))
79- . ' /* ' ;
80- }
81- }
82- }
83-
8468}
You can’t perform that action at this time.
0 commit comments