Make CSS Hot-reload work in a hacky way
This commit is contained in:
parent
4b12b711ee
commit
b677edbc58
5 changed files with 174 additions and 28 deletions
33
src/vector/devcss.ts
Normal file
33
src/vector/devcss.ts
Normal file
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
Copyright 2021 The Matrix.org Foundation C.I.C.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* This code will be autoremoved on production builds.
|
||||
* The purpose of this code is that the webpack's `string-replace-loader`
|
||||
* pretty much search for this string in this specific file and replaces it
|
||||
* like a macro before any previous compilations, which allows us to inject
|
||||
* some css requires statements that are specific to the themes we have turned
|
||||
* on by ourselves. Without that very specific workaround, webpack would just
|
||||
* import all the CSSes, which would make the whole thing useless, as on my
|
||||
* machine with i9 the recompilation for all themes turned ou would take way
|
||||
* over 30s, which is definitely too high for nice css reloads speed.
|
||||
*
|
||||
* For more details, see webpack.config.js:184 (string-replace-loader)
|
||||
*/
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
"use theming";
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue