title: How to integrate Tinymce with Symfony encore?
body: <p>I have a <strong>Symfony4</strong> project using <strong>flex</strong> and <strong>encore</strong>. I would like to add tinymce.</p>
  
  <p>So I add tinymce project:</p>
  
  <pre><code>$ yarn add tinymce
  </code></pre>
  
  <p>I edited my <code>app.js</code> file:</p>
  
  <pre><code>require('../css/app.scss');
  
  // Import TinyMCE
  import tinymce from 'tinymce/tinymce';
  
  // A theme is also required
  import 'tinymce/themes/modern/theme';
  
  // Any plugins you want to use has to be imported
  import 'tinymce/plugins/paste';
  import 'tinymce/plugins/link';
  
  // Initialize the app
  tinymce.init({
      selector: 'textarea',
  
      plugins: ['paste', 'link']
  });
  </code></pre>
  
  <p>I compiled:</p>
  
  <pre><code>$ yarn run encore dev
  </code></pre>
  
  <p>Compilation is successfull:</p>
  
  <pre><code>Running webpack ...
  
   DONE  Compiled successfully in 17600ms                                                                                                                                                                                                             
  
   I  8 files written to public\build
  Done in 20.23s.
  </code></pre>
  
  <p>My textareas are replaced by a blank page. </p>
  
  <p>I found the solution in <a href="https://www.tinymce.com/docs/advanced/usage-with-module-loaders/#gettingtheskin" rel="noreferrer">documentation</a> and it works fine when I copy the <code>node_modules/tinymce/skins</code> directory to <code>/public/build/skins</code>. But I still have to do it after each yarn compilation</p>
  
  <p><strong>Is there a way to automatically copy this <code>node_modules/tinymce/skins</code> directory to <code>/public/build/skins</code>?</strong> IS it possible to update the <code>webpack.config.js</code> to do it?</p>
  
  <p>PS: I read some <a href="https://www.tinymce.com/docs/advanced/usage-with-module-loaders/#webpackfile-loader" rel="noreferrer">recommandations</a> with the <code>webpack-loader</code>, but I don't understand what I have to do.</p>