Solución:
OPCIÓN 1: RECOMENDADA: el incorporado copyFiles
función
Utilice la función integrada de Encore copyFiles
función.
var Encore = require('@symfony/webpack-encore');
//...
Encore
// directory where compiled assets will be stored
.setOutputPath('public/build/')
// public path used by the web server to access the output path
.setPublicPath('/build')
// copy tinymce's skin files
.copyFiles({
from: 'node_modules/tinymce/skins',
to: 'skins/[path]/[name].[ext]'
})
Referencia de la API de Encore.
OPCIÓN 2: el complemento de copia webpack
Agregué el complemento de copia webpack
yarn add copy-webpack-plugin --dev
Edité mi webpack.config.js para agregar solo 4 líneas:
var Encore = require('@symfony/webpack-encore');
//DECLARATION OF THE NEW PLUGIN
var CopyWebpackPlugin = require('copy-webpack-plugin');
Encore
// the project directory where all compiled assets will be stored
.setOutputPath('public/build/')
// the public path used by the web server to access the previous directory
.setPublicPath('/build')
// will create public/build/admin/app.js and public/build/admin/app.css
.addEntry('admin', './assets/js/app.js')
//Some project lines
//...
//...
//I call the plugin with its new syntax (since 3.11)
.addPlugin(new CopyWebpackPlugin({
patterns: [
// Copy the skins from tinymce to the build/skins directory
{ from: 'node_modules/tinymce/skins', to: 'skins' },
],
}))
//Some project lines
//...
//...
;
// export the final configuration
module.exports = Encore.getWebpackConfig();
Gracias por tu publicación … Resolvió mi problema con una ligera diferencia para mí. Tuve que poner las pieles
/public/build/js/skins
Así que cambié la configuración del paquete web de
.addPlugin(new CopyWebpackPlugin([
// Copy the skins from tinymce to the build/skins directory
{ from: 'node_modules/tinymce/skins', to: 'skins' },
]))
para
.addPlugin(new CopyWebpackPlugin([
// Copy the skins from tinymce to the build/skins directory
{ from: 'node_modules/tinymce/skins', to: 'js/skins' },
]))
Y funciona ! gracias de nuevo !
¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)