Ledzz / angular2-tinymce

Angular 2 component for TinyMCE MCE WYSIWYG editor
https://angular2-tinymce.surge.sh
66 stars 37 forks source link

Refused to apply style from <URL> because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled angular #72

Closed IgorKurkov closed 5 years ago

IgorKurkov commented 5 years ago

Angular 6 was added skin.min.css to angular.json "styles": ["node_modules/tinymce/skins/lightgray/skin.min.css"] "scripts": ["node_modules/tinymce/tinymce.min.js"] image I guess this behavior happens because tinyMCE want to be loaded by https. found some like this https://github.com/tinymce/tinymce/issues/2902, but it not helpful for me.

Ledzz commented 5 years ago

no, you should copy your skin to your assets folder, not include it from node_modules. Read the manual carefully please

IgorKurkov commented 5 years ago

Then copy lightgray skin files from node_modules/tinymce to the /assets folder. So, i.e. there must be available /assets/tinymce/skins/lightgray/skin.min.css and > /assets/tinymce/skins/lightgray/content.min.css file. You can override skin path by specifying skin_url option (default /assets/tinymce/skins/lightgray).

I guess to make a copy of TinyMCE lib to /assets/is not a good way, because we can't update lib in future - or must update it manually. Otherwise, if we already agree with this decision - so we must put js lib toassets/js/<js lib name> because it will semantically better I guess. These are only suggestions. So I solve these cases by loading plugins from node_modules, and current issue - by specifying skin_url to already copied only CSS skin in /assets/css/skin/.... But your project solves a problem to connect TinyMCE locally - not from the tiny.cloud - so today this is the best solution for angular+tinymce. Works fine. Thanks a lot!) Best regards :)

gortok commented 4 years ago

no, you should copy your skin to your assets folder, not include it from node_modules. Read the manual carefully please

This bothers me.

If you use Webpack, you have a dist/ folder where all of this stuff gets dropped, and you use angular.json to include it.

At least right now, you run npm install tinymce which puts all the scripts in your node_modules folder (as it should).

Why would you want to take an extra step that would be handled for you for free if you used the node_modules folder as the source?