Mes pages sont donc toute vide de style.
Ma configuration de webpack.encore :
Code : Tout sélectionner
var Encore = require('@symfony/webpack-encore');
var CopyWebpackPlugin = require('copy-webpack-plugin');
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')
.cleanupOutputBeforeBuild()
.enableSourceMaps(!Encore.isProduction())
/*
* ENTRY CONFIG
*
* Add 1 entry for each "page" of your app
* (including one that's included on every page - e.g. "app")
*
* Each entry will result in one JavaScript file (e.g. app.js)
* and one CSS file (e.g. app.css) if you JavaScript imports CSS.
*/
.addEntry('app', './assets/js/app.js')
// will require an extra script tag for runtime.js
// but, you probably want this, unless you're building a single-page app
.enableSingleRuntimeChunk()
// enables Sass/SCSS support
.enableSassLoader()
.addPlugin(new CopyWebpackPlugin([
{ from: './assets/images', to: 'images' }
]))
.enableVueLoader();
;
module.exports = Encore.getWebpackConfig();
les fichiers compilés apparaissent bien dans le dossieryarn encore dev
.public\build\
Mon base.html.twig :
Code : Tout sélectionner
{% block stylesheets %}
{{ encore_entry_link_tags('app') }}
{% endblock %}
Code : Tout sélectionner
{% block javascripts %}
{{ encore_entry_script_tags('app') }}
{% endblock %}
et<link rel="stylesheet" href="/build/app.css">
. Suivant les différentes doc et tutos trouvés je n'arrive pas à voir ce que je fais de mal...<script src="/build/runtime.js"></script><script src="/build/app.js"></script>