Skip to content

Commit 023fcb9

Browse files
committed
feat: remove script locals, close #120
1 parent 82a356c commit 023fcb9

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lib/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ module.exports = function postHTMLExpressions (options) {
115115
scopeTags: ['scope'],
116116
ignoredTag: 'raw',
117117
strictMode: true,
118-
localsAttr: 'locals'
118+
localsAttr: 'locals',
119+
removeScriptLocals: false
119120
}, options)
120121

121122
// set tags

lib/locals.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ function scriptDataLocals (tree, options) {
3434
} catch {};
3535
}
3636

37+
if (options.removeScriptLocals) {
38+
return ''
39+
}
40+
3741
return node
3842
})
3943

0 commit comments

Comments
 (0)