Estoy tratando de usar el complemento Tinymce en un elemento de área de texto:
<textarea id="reportDescription" name="reportDescription" class="form-control" rows="4"></textarea>Estoy trabajando con Symfony y Webpack Encore. Entonces instalé el paquete usando:
yarn add tinymceEn webpack.config.js codifiqué:
.copyFiles({ from: 'node_modules/tinymce/skins', to: 'skins/[path]/[name].[ext]' })Y en el .js donde intento inicializar el complemento:
require('tinymce'); $(document).ready(function () { if($("#reportDescription").length > 0){ tinymce.init({ selector: "textarea#reportDescription" }); } });Cuando cargo mi página en mi navegador, aparece este error:
tinymce.js:4680 GET http://url/build/models/dom/model.js net::ERR_ABORTED 404 (Not Found) tinymce.js:18181 Failed to load model: dom from url models/dom/model.js tinymce.js:4680 GET http://url/build/icons/default/icons.js net::ERR_ABORTED 404 (Not Found) tinymce.js:18181 Failed to load icons: default from url http://url/build/icons/default/icons.js tinymce.js:4680 GET http://url/build/themes/silver/theme.js net::ERR_ABORTED 404 (Not Found) tinymce.js:18181 Failed to load theme: silver from url themes/silver/theme.jsTodavía no entiendo muy bien cómo trabajar con módulos en webpack. Cómo importarlos, cuándo usar require o import y la diferencia entre ellos. Así que tal vez me estoy perdiendo algo importante.