diff options
author | Hsieh Chin Fan <pham@topo.tw> | 2024-09-15 15:12:23 +0800 |
---|---|---|
committer | Hsieh Chin Fan <pham@topo.tw> | 2024-09-15 15:16:13 +0800 |
commit | d02dafa0b0c1717aa73305723d4edaf0f0b3316e (patch) | |
tree | 2fbed1e4b571c19a2c2a50dd79c63704c2d34e0e /rollup.config.js | |
parent | 835819f443baecd2220db9bb8a80fb0e43bede3d (diff) |
chore: patch eefd82a
Remove scroll event made by plain-draggable in build stage
This change prevents inline style of draggable element got changed with
ANY scroll event. (Especially width/height set by resize event)
Ref: https://github.com/anseki/plain-draggable/issues/124
Diffstat (limited to 'rollup.config.js')
-rw-r--r-- | rollup.config.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/rollup.config.js b/rollup.config.js index d04eb4e..78a4123 100644 --- a/rollup.config.js +++ b/rollup.config.js | |||
@@ -29,6 +29,16 @@ const general = { | |||
29 | }, | 29 | }, |
30 | }, | 30 | }, |
31 | { | 31 | { |
32 | name: 'plain-draggable', | ||
33 | transform(code, id) { | ||
34 | if (id.includes('node_modules/plain-draggable/')) { | ||
35 | const removePattern = /window\.addEventListener\('scroll'[^\)]*\)/ | ||
36 | return `${code.replace(removePattern, "")}`; | ||
37 | } | ||
38 | return null; | ||
39 | }, | ||
40 | }, | ||
41 | { | ||
32 | name: 'mapclay', | 42 | name: 'mapclay', |
33 | resolveId(source) { | 43 | resolveId(source) { |
34 | if (source === 'mapclay' && existsSync(join('.', 'mapclay'))) { | 44 | if (source === 'mapclay' && existsSync(join('.', 'mapclay'))) { |