mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +08:00
fix: also account for apply in dispose code
This commit is contained in:
@ -23,13 +23,19 @@ export default function loader(content, map) {
|
|||||||
this.query
|
this.query
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const disposeCode = options.apply
|
||||||
|
? dedent`
|
||||||
|
const { removeTaggedAdditionalCSS } = require("@nativescript/core/ui/styling/style-scope");
|
||||||
|
removeTaggedAdditionalCSS(${tag})
|
||||||
|
`
|
||||||
|
: ``;
|
||||||
|
|
||||||
const hmrCode = this.hot
|
const hmrCode = this.hot
|
||||||
? dedent`
|
? dedent`
|
||||||
if(module.hot) {
|
if(module.hot) {
|
||||||
module.hot.accept()
|
module.hot.accept()
|
||||||
module.hot.dispose(() => {
|
module.hot.dispose(() => {
|
||||||
const { removeTaggedAdditionalCSS } = require("@nativescript/core/ui/styling/style-scope");
|
${disposeCode}
|
||||||
removeTaggedAdditionalCSS(${tag})
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
Reference in New Issue
Block a user