Prefix TinyMCE to avoid conflicts with other plugins

This commit is contained in:
Jan Jakeš
2019-05-23 08:34:08 +02:00
committed by M. Shull
parent 8a76706a26
commit b421708e5e
3 changed files with 35 additions and 0 deletions

10
package-lock.json generated
View File

@ -10365,6 +10365,16 @@
"integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=",
"dev": true
},
"string-replace-loader": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/string-replace-loader/-/string-replace-loader-2.1.1.tgz",
"integrity": "sha512-0Nvw1LDclF45AFNuYPcD2Jvkv0mwb/dQSnJZMvhqGrT+zzmrpG3OJFD600qfQfNUd5aqfp7fCm2mQMfF7zLbyQ==",
"dev": true,
"requires": {
"loader-utils": "^1.1.0",
"schema-utils": "^0.4.5"
}
},
"string-width": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",

View File

@ -100,6 +100,7 @@
"postcss-cli": "^6.1.2",
"sinon": "1.14.1",
"sinon-chai": "2.7.0",
"string-replace-loader": "^2.1.1",
"stylelint": "^10.1.0",
"stylelint-order": "^3.0.0",
"stylelint-scss": "^3.8.0",

View File

@ -242,6 +242,30 @@ const baseConfig = {
'babel-loader',
]
},
{
test: /node_modules\/tinymce/,
loader: 'string-replace-loader',
options: {
// prefix TinyMCE to avoid conflicts with other plugins
multiple: [
{
search: 'window\\.tinymce',
replace: 'window.mailpoetTinymce',
flags: 'g',
},
{
search: 'tinymce\\.util',
replace: 'window.mailpoetTinymce.util',
flags: 'g',
},
{
search: 'resolve\\(\'tinymce',
replace: 'resolve(\'mailpoetTinymce',
flags: 'g',
},
],
},
},
]
}
};