{"id":7905,"date":"2021-05-07T00:00:00","date_gmt":"2021-05-06T22:00:00","guid":{"rendered":"https:\/\/blog.ouidou.fr\/?p=7905"},"modified":"2025-12-08T09:20:44","modified_gmt":"2025-12-08T08:20:44","slug":"webpacker-the-highway-to-hell","status":"publish","type":"post","link":"https:\/\/ouidou.fr\/blog\/articles-techniques\/webpacker-the-highway-to-hell","title":{"rendered":"Webpacker : the highway to hell"},"content":{"rendered":"<p><em>Article \u00e9crit par Martin Catty<\/em><\/p>\n<h2 id=\"un-outil-pour-les-gouverner-tous\">Un outil pour les gouverner tous<\/h2>\n<p>Note I\u00a0: dans cet article quand je parle de production il s\u2019agit du mode production plut\u00f4t que d\u2019environnement de production.<\/p>\n<p>Note II\u00a0: <a href=\"https:\/\/rubygems.org\/gems\/webpacker\">Webpacker<\/a> est une gem permettant d\u2019utiliser Webpack dans une application Ruby.<\/p>\n<p>Note III\u00a0: Juste parce que j\u2019aime bien <a href=\"https:\/\/www.lemonde.fr\/m-le-mag\/article\/2021\/03\/25\/faut-il-en-finir-avec-les-chiffres-romains_6074436_4500055.html\">les chiffres romains<\/a>.<\/p>\n<p>Nos applications Rails, d\u00e8s lors qu\u2019elles quittent nos machines, tournent toujours dans un mode production, aussi bien sur un environnement de pr\u00e9-production que de revue.<\/p>\n<p>Lorsque nous d\u00e9marrons de nouveaux projets, nous utilisons notre g\u00e9n\u00e9rateur de projets, r\u00e9pondant au doux nom d\u2019Opsible (car utilisant Ansible) et qui nous permet de mettre en place une application pr\u00eate \u00e0 l\u2019emploi, aussi bien localement qu\u2019en production.<\/p>\n<p>Tous nos projets utilisant <a href=\"https:\/\/www.synbioz.com\/blog\/tech\/premiers-pas-avec-docker\">Docker<\/a>, l\u2019outil est en charge de mettre en place une configuration fonctionnelle.<\/p>\n<p>Il s\u2019appuie \u00e9galement sur des <a href=\"https:\/\/www.synbioz.com\/blog\/tech\/les-templates-rails\">templates Rails<\/a> pour nous permettre de cr\u00e9er de pures API\u00a0ou des monolithes.<\/p>\n<p>Lors d\u2019une nouvelle mise \u00e0 jour d\u2019Opsible s\u2019est repos\u00e9e la sempiternelle question\u00a0: Sprockets et\/ou Webpacker\u00a0?<\/p>\n<h2 id=\"sprockets-etou-webpacker\">Sprockets et\/ou Webpacker\u00a0?<\/h2>\n<p>Si vous lisez le guide Ruby on Rails d\u00e9di\u00e9 \u00e0 Webpacker la r\u00e9ponse est tr\u00e8s claire (<code>&lt;\/troll&gt;<\/code>) : vous pouvez utiliser les deux pour faire \u2026 les m\u00eames choses.<\/p>\n<blockquote><p>New Rails apps are configured to use webpack for JavaScript and Sprockets for CSS, although you can do CSS in webpack.<\/p><\/blockquote>\n<p>Dans l\u2019\u00e9quipe notre consensus \u00e9tait clair\u00a0: Webpack a plut\u00f4t vocation \u00e0 \u00eatre utilis\u00e9 lorsqu\u2019on int\u00e8gre des app riches dans notre monolithe.<\/p>\n<p>Comprenez que d\u00e8s que l\u2019on souhaite <a href=\"https:\/\/www.synbioz.com\/blog\/tech\/introduction-a-vuejs-construisons-une-memebox\">int\u00e9grer des frameworks front type Vue.js<\/a> nous mettons en place Webpacker.<\/p>\n<p>Sauf que celui-ci venait en addition de Sprockets plut\u00f4t qu\u2019en remplacement.<\/p>\n<h2 id=\"qui-peut-le-plus-peut-le-moins\">Qui peut le plus peut le moins<\/h2>\n<p>D\u00e8s lors qu\u2019on bascule dans ce <em>setup<\/em> qui mix les deux approches, ceux qui travaillent sur des parties sans Webpack ont un peu l\u2019impression de se faire avoir.<\/p>\n<p>Ils font tourner les processus n\u00e9cessaires \u00e0 Webpacker, notamment un serveur d\u00e9di\u00e9 \u00e0 la recompilation des assets, sans en profiter.<\/p>\n<p>En effet, Webpack offre des avantages non n\u00e9gligeables comme le <em>hot reloading<\/em> et le <em>hot module replacement<\/em>, offrant une exp\u00e9rience de d\u00e9veloppement bien plus fluide.<\/p>\n<p>D\u00e8s lors, nous avons d\u00e9cid\u00e9 pour nos nouveaux projets de ne garder que Webpacker.<\/p>\n<h2 id=\"de-la-bonne-configuration-de-webpacker\">De la bonne configuration de Webpacker<\/h2>\n<p>Avec Webpacker la r\u00e8gle est simple\u00a0: tant que vous n\u2019\u00eates pas en production vous n\u2019\u00eates pas s\u00fbr que \u00e7a fonctionne.<\/p>\n<p>L\u00e0 o\u00f9 Rails nous a habitu\u00e9 \u00e0 son <em>convention over configuration<\/em>, dans le contexte de Webpack il semble n\u2019y avoir \u00e9tonnamment pas de consensus fort sur la bonne fa\u00e7on d\u2019organiser ses fichiers, quand l\u2019utiliser, etc.<\/p>\n<p>Pour mat\u00e9rialiser les soucis qu\u2019on peut rencontrer lors de sa mise en place je vais prendre un cas d\u2019usage dans l\u2019air du temps\u00a0: l\u2019int\u00e9gration de <a href=\"https:\/\/tailwindcss.com\/\">Tailwind<\/a> dans notre application.<\/p>\n<p>La configuration de Webpacker (<code>config\/webpacker.yml<\/code>) est d\u00e9coup\u00e9e en environnements, vous aurez donc probablement une configuration <code>development<\/code> et une <code>production<\/code> \u00e0 minima (nous y reviendrons).<\/p>\n<p>Notre objectif est de ne garder dans notre <em>layout<\/em> que les deux balises suivantes :<\/p>\n<div class=\"language-slim highlighter-rouge\">\n<div class=\"highlight\">\n<pre class=\"highlight\"><code><span class=\"p\">=<\/span> <span class=\"n\">stylesheet_pack_tag<\/span>  <span class=\"s2\">\"application\"<\/span><span class=\"p\">,<\/span> <span class=\"ss\">media: <\/span><span class=\"s2\">\"all\"<\/span><span class=\"p\">,<\/span> <span class=\"s2\">\"data-turbolinks-track\"<\/span><span class=\"p\">:<\/span> <span class=\"s2\">\"reload\"<\/span> <span class=\"p\">=<\/span> <span class=\"n\">javascript_pack_tag<\/span>  <span class=\"s2\">\"application\"<\/span><span class=\"p\">,<\/span> <span class=\"s2\">\"data-turbolinks-track\"<\/span><span class=\"p\">:<\/span> <span class=\"s2\">\"reload\"<\/span> <\/code><\/pre>\n<\/div>\n<\/div>\n<p>Notre configuration par d\u00e9faut de Webpacker est la suivante\u00a0:<\/p>\n<div class=\"language-yaml highlighter-rouge\">\n<div class=\"highlight\">\n<pre class=\"highlight\"><code><span class=\"na\">default<\/span><span class=\"pi\">:<\/span> <span class=\"nl\">&amp;default<\/span>   <span class=\"na\">source_path<\/span><span class=\"pi\">:<\/span> <span class=\"s\">app\/javascript<\/span>   <span class=\"na\">source_entry_path<\/span><span class=\"pi\">:<\/span> <span class=\"s\">packs<\/span>   <span class=\"na\">public_root_path<\/span><span class=\"pi\">:<\/span> <span class=\"s\">public<\/span>   <span class=\"na\">public_output_path<\/span><span class=\"pi\">:<\/span> <span class=\"s\">packs<\/span>   <span class=\"na\">cache_path<\/span><span class=\"pi\">:<\/span> <span class=\"s\">tmp\/cache\/webpacker<\/span>   <span class=\"na\">webpack_compile_output<\/span><span class=\"pi\">:<\/span> <span class=\"no\">true<\/span>   <span class=\"na\">check_yarn_integrity<\/span><span class=\"pi\">:<\/span> <span class=\"no\">false<\/span>   <span class=\"s\">\u2026<\/span> <\/code><\/pre>\n<\/div>\n<\/div>\n<p>Rien de complexe ici, par d\u00e9faut nos fichiers seront recherch\u00e9s dans <code>app\/javascript<\/code>. Les \u00ab\u00a0manifestes\u00a0\u00bb devront se trouver dans le dossier <code>packs<\/code>. Les dossiers de sortie des fichiers compil\u00e9s seront dans <code>public\/packs<\/code>.<\/p>\n<p>Sans perdre de temps nous voil\u00e0 en route pour int\u00e9grer Tailwind. L\u2019un des avantages de Webpacker est de pouvoir facilement int\u00e9grer des biblioth\u00e8ques publi\u00e9es sous forme de paquets NPM.<\/p>\n<p>Ni une ni deux\u00a0:<\/p>\n<div class=\"language-bash highlighter-rouge\">\n<div class=\"highlight\">\n<pre class=\"highlight\"><code>yarn add tailwindcss yarn tailwind init <\/code><\/pre>\n<\/div>\n<\/div>\n<p>Puis on configure notre fichier <code>postcss.config.js<\/code>\u00a0:<\/p>\n<div class=\"language-javascript highlighter-rouge\">\n<div class=\"highlight\">\n<pre class=\"highlight\"><code><span class=\"nx\">module<\/span><span class=\"p\">.<\/span><span class=\"nx\">exports<\/span> <span class=\"o\">=<\/span> <span class=\"p\">{<\/span>   <span class=\"na\">plugins<\/span><span class=\"p\">:<\/span> <span class=\"p\">[<\/span>     <span class=\"nx\">require<\/span><span class=\"p\">(<\/span><span class=\"dl\">\"<\/span><span class=\"s2\">postcss-import<\/span><span class=\"dl\">\"<\/span><span class=\"p\">),<\/span>     <span class=\"nx\">require<\/span><span class=\"p\">(<\/span><span class=\"dl\">\"<\/span><span class=\"s2\">tailwindcss<\/span><span class=\"dl\">\"<\/span><span class=\"p\">),<\/span> <span class=\"c1\">\/\/ on ajoute cette ligne uniquement<\/span>     <span class=\"nx\">require<\/span><span class=\"p\">(<\/span><span class=\"dl\">\"<\/span><span class=\"s2\">postcss-flexbugs-fixes<\/span><span class=\"dl\">\"<\/span><span class=\"p\">),<\/span>     <span class=\"nx\">require<\/span><span class=\"p\">(<\/span><span class=\"dl\">\"<\/span><span class=\"s2\">postcss-preset-env<\/span><span class=\"dl\">\"<\/span><span class=\"p\">)({<\/span>       <span class=\"na\">autoprefixer<\/span><span class=\"p\">:<\/span> <span class=\"p\">{<\/span>         <span class=\"na\">flexbox<\/span><span class=\"p\">:<\/span> <span class=\"dl\">\"<\/span><span class=\"s2\">no-2009<\/span><span class=\"dl\">\"<\/span>       <span class=\"p\">},<\/span>       <span class=\"na\">stage<\/span><span class=\"p\">:<\/span> <span class=\"mi\">3<\/span>     <span class=\"p\">})<\/span>   <span class=\"p\">]<\/span> <span class=\"p\">};<\/span> <\/code><\/pre>\n<\/div>\n<\/div>\n<p>On part sur une arborescence de la sorte pour organiser notre JavaScript\u00a0:<\/p>\n<pre><code>app\/javascript \u251c\u2500\u2500 channels \u2502\u00a0\u00a0 \u251c\u2500\u2500 consumer.js \u2502\u00a0\u00a0 \u2514\u2500\u2500 index.js \u2514\u2500\u2500 packs     \u2514\u2500\u2500 application.js <\/code><\/pre>\n<p>Et celle ci pour nos CSS\u00a0:<\/p>\n<pre><code>app\/stylesheet \u2514\u2500\u2500 app.scss <\/code><\/pre>\n<p>Dans notre manifeste <code>application.js<\/code> on va r\u00e9f\u00e9rencer nos fichiers CSS, c\u2019est une pratique normale de Webpack qui fonctionne sur un m\u00e9canisme d\u2019import.<\/p>\n<p>D\u00e8s lors que les fichiers CSS ont \u00e9t\u00e9 r\u00e9f\u00e9renc\u00e9s, ils sont utilisables dans notre application et cela fonctionne m\u00eame sans directive d\u2019import de notre manifeste CSS dans notre <em>layout<\/em>.<\/p>\n<div class=\"language-javascript highlighter-rouge\">\n<div class=\"highlight\">\n<pre class=\"highlight\"><code><span class=\"k\">import<\/span> <span class=\"nx\">Rails<\/span> <span class=\"k\">from<\/span> <span class=\"dl\">\"<\/span><span class=\"s2\">@rails\/ujs<\/span><span class=\"dl\">\"<\/span><span class=\"p\">;<\/span> <span class=\"k\">import<\/span> <span class=\"nx\">Turbolinks<\/span> <span class=\"k\">from<\/span> <span class=\"dl\">\"<\/span><span class=\"s2\">turbolinks<\/span><span class=\"dl\">\"<\/span><span class=\"p\">;<\/span> <span class=\"k\">import<\/span> <span class=\"o\">*<\/span> <span class=\"k\">as<\/span> <span class=\"nx\">ActiveStorage<\/span> <span class=\"k\">from<\/span> <span class=\"dl\">\"<\/span><span class=\"s2\">@rails\/activestorage<\/span><span class=\"dl\">\"<\/span><span class=\"p\">;<\/span> <span class=\"k\">import<\/span> <span class=\"dl\">\"<\/span><span class=\"s2\">channels<\/span><span class=\"dl\">\"<\/span><span class=\"p\">;<\/span>  <span class=\"k\">import<\/span> <span class=\"dl\">\"<\/span><span class=\"s2\">..\/..\/stylesheet\/app.scss<\/span><span class=\"dl\">\"<\/span><span class=\"p\">;<\/span> <span class=\"c1\">\/\/ on ajoute cette ligne<\/span>  <span class=\"nx\">Rails<\/span><span class=\"p\">.<\/span><span class=\"nx\">start<\/span><span class=\"p\">();<\/span> <span class=\"nx\">Turbolinks<\/span><span class=\"p\">.<\/span><span class=\"nx\">start<\/span><span class=\"p\">();<\/span> <span class=\"nx\">ActiveStorage<\/span><span class=\"p\">.<\/span><span class=\"nx\">start<\/span><span class=\"p\">();<\/span> <\/code><\/pre>\n<\/div>\n<\/div>\n<p>Le torse bomb\u00e9 on relance notre serveur webpack et l\u00e0, c\u2019est le drame.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/narcisse.synbioz.com\/attachments\/dd2ee879-224a-4b7e-884e-aaf2923df072\/variants\/54b291c2-04f9-46c8-ad9f-c269ad6dab6d\/src\" alt=\"Erreur postcss 8\" \/><\/p>\n<p>Visiblement Tailwind veut la version 8 de PostCSS. Mais cette version n\u2019est pas compatible avec la version stable actuelle de Webpacker (5.3).<\/p>\n<p>Combatif, on ne l\u00e2che pas l\u2019affaire, il se trouve qu\u2019il y a une version de Tailwind compatible avec PostCSS 7.<\/p>\n<pre><code>yarn remove tailwindcss yarn add tailwindcss@npm:@tailwindcss\/postcss7-compat postcss@^7 autoprefixer@^9 <\/code><\/pre>\n<p>Magnifique, on peut maintenant \u00e9crire des styles dans notre fichier <code>app\/stylesheet\/app.scss<\/code>, ceux-ci seront appliqu\u00e9s \u00e0 la vol\u00e9e.<\/p>\n<p>Profitons-en pour importer \u00e9galement Tailwind (qui n\u2019est pas encore charg\u00e9 \u00e0 ce stade), on aura au final dans notre fichier <code>app.scss<\/code>\u00a0:<\/p>\n<div class=\"language-css highlighter-rouge\">\n<div class=\"highlight\">\n<pre class=\"highlight\"><code><span class=\"k\">@import<\/span> <span class=\"s1\">\"tailwindcss\/base\"<\/span><span class=\"p\">;<\/span> <span class=\"k\">@import<\/span> <span class=\"s1\">\"tailwindcss\/utilities\"<\/span><span class=\"p\">;<\/span> <span class=\"k\">@import<\/span> <span class=\"s1\">\"tailwindcss\/components\"<\/span><span class=\"p\">;<\/span> <\/code><\/pre>\n<\/div>\n<\/div>\n<p>Cela fonctionne bien, avec un b\u00e9mol\u00a0:<\/p>\n<pre><code>webpack_1  | \u2139 \uff62wdm\uff63: Compiled successfully. webpack_1  | \u2139 \uff62wdm\uff63: Compiling... webpack_1  | \u2139 \uff62wdm\uff63: Hash: e0f5684b0fd5ecd26488 webpack_1  | Version: webpack 4.46.0 webpack_1  | Time: 4470ms <\/code><\/pre>\n<p>Quasiment 5 secondes de compilation, et ce \u00e0 chaque fois qu\u2019on va introduire une directive dans le fichier. Cela tient au fait que Tailwind contient une t\u00e9trachi\u00e9e de classes utilitaires, pr\u00eates \u00e0 l\u2019emploi et mises \u00e0 disposition m\u00eame si on ne s\u2019en sert pas.<\/p>\n<p>Pour y palier on va d\u00e9couper notre fichier en deux\u00a0:<\/p>\n<pre><code>app\/stylesheet \u251c\u2500\u2500 app.scss \u2514\u2500\u2500 tailwind.scss <\/code><\/pre>\n<p>Le nouveau fichier <code>tailwind.scss<\/code> ne contiendra que les directives relatives \u00e0 ce dernier. Lorsqu\u2019on \u00e9dite notre fichier <code>app.scss<\/code>, on revient \u00e0 des temps acceptables\u00a0:<\/p>\n<pre><code>webpack_1  | \u2139 \uff62wdm\uff63: Compiled successfully. webpack_1  | \u2139 \uff62wdm\uff63: Compiling... webpack_1  | \u2139 \uff62wdm\uff63: Hash: 9f7a514f5e27f38ab57e webpack_1  | Version: webpack 4.46.0 webpack_1  | Time: 156ms <\/code><\/pre>\n<p>Maintenant que tout est en ordre il faut qu\u2019on pr\u00e9pare notre configuration pour la production. Si la balise suivante est inutile en local, elle le sera en production\u00a0:<\/p>\n<pre><code>= stylesheet_pack_tag  \"application\", media: \"all\", \"data-turbolinks-track\": \"reload\" <\/code><\/pre>\n<p>On va donc cr\u00e9er notre manifeste\u00a0:<\/p>\n<pre><code>app\/javascript\/packs \u251c\u2500\u2500 application.js \u2514\u2500\u2500 application.scss <\/code><\/pre>\n<p>Qui contient les m\u00eame instructions\u00a0:<\/p>\n<div class=\"language-css highlighter-rouge\">\n<div class=\"highlight\">\n<pre class=\"highlight\"><code><span class=\"k\">@import<\/span> <span class=\"s1\">\"..\/..\/stylesheet\/tailwind.scss\"<\/span><span class=\"p\">;<\/span> <span class=\"k\">@import<\/span> <span class=\"s1\">\"..\/..\/stylesheet\/app.scss\"<\/span><span class=\"p\">;<\/span> <\/code><\/pre>\n<\/div>\n<\/div>\n<p>On rajoute quelques directives dans notre fichier <code>app.scss<\/code> et l\u00e0 surprise, notre build prend de nouveau 5 secondes\u00a0!<\/p>\n<pre><code>webpack_1  | \u2139 \uff62wdm\uff63: Compiling... webpack_1  | \u2139 \uff62wdm\uff63: Hash: 36fdd1b07e74458fd268 webpack_1  | Version: webpack 4.46.0 webpack_1  | Time: 4754ms webpack_1  | Built at: 04\/27\/2021 2:35:27 PM <\/code><\/pre>\n<p>Et oui d\u00e8s lors que notre manifeste est d\u00e9clar\u00e9, l\u2019ensemble des fichiers qui y sont r\u00e9f\u00e9renc\u00e9s vont \u00eatre surveill\u00e9s et compil\u00e9s.<\/p>\n<p>Pour \u00e9viter cela nous avons d\u00e9cid\u00e9 de d\u00e9clarer le manifeste dans un dossier qui ne sera utilis\u00e9 que pour la production.<\/p>\n<pre><code>production:   &lt;&lt;: *default    additional_paths: [\"app\/stylesheet\"] <\/code><\/pre>\n<pre><code>app\/stylesheet \u251c\u2500\u2500 app.scss \u251c\u2500\u2500 packs \u2502\u00a0\u00a0 \u2514\u2500\u2500 application.scss \u2514\u2500\u2500 tailwind.scss <\/code><\/pre>\n<p>S\u2019en est tout de mes p\u00e9r\u00e9grinations dans le pays merveilleux de Webpack(er). Je vous ai toutefois laiss\u00e9 avec un probl\u00e8me \u00e0 r\u00e9soudre, celui de <a href=\"https:\/\/purgecss.com\/\">retirer les CSS inutilis\u00e9es<\/a> dans votre build de production (autrement le fichier Tailwind p\u00e8se quelque 3Mo non compress\u00e9).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>R\u00e9flexions pour une configuration de Webpacker utilisable efficacement en d\u00e9veloppement et en production<\/p>\n","protected":false},"author":10,"featured_media":12490,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","inline_featured_image":false,"fifu_image_url":"","fifu_image_alt":"","footnotes":""},"categories":[34],"tags":[],"class_list":["post-7905","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-articles-techniques"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Webpacker : the highway to hell - Ouidou<\/title>\n<meta name=\"description\" content=\"Nos experts analysent Webpacker et ses d\u00e9fis : comprendre pourquoi il peut transformer vos projets en cauchemar.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ouidou.fr\/blog\/articles-techniques\/webpacker-the-highway-to-hell\" \/>\n<meta property=\"og:locale\" content=\"fr_FR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Webpacker : the highway to hell - Ouidou\" \/>\n<meta property=\"og:description\" content=\"Nos experts analysent Webpacker et ses d\u00e9fis : comprendre pourquoi il peut transformer vos projets en cauchemar.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ouidou.fr\/blog\/articles-techniques\/webpacker-the-highway-to-hell\" \/>\n<meta property=\"og:site_name\" content=\"Ouidou\" \/>\n<meta property=\"article:published_time\" content=\"2021-05-06T22:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-12-08T08:20:44+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ouidou.fr\/blog\/wp-content\/uploads\/2021\/05\/Webpacker-the-highway-to-hell.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1105\" \/>\n\t<meta property=\"og:image:height\" content=\"564\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Sara Lourties\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u00c9crit par\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sara Lourties\" \/>\n\t<meta name=\"twitter:label2\" content=\"Dur\u00e9e de lecture estim\u00e9e\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/ouidou.fr\\\/blog\\\/articles-techniques\\\/webpacker-the-highway-to-hell#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ouidou.fr\\\/blog\\\/articles-techniques\\\/webpacker-the-highway-to-hell\"},\"author\":{\"name\":\"Sara Lourties\",\"@id\":\"https:\\\/\\\/ouidou.fr\\\/blog\\\/#\\\/schema\\\/person\\\/e1d66085fb7c22ede319ce56adc373a4\"},\"headline\":\"Webpacker : the highway to hell\",\"datePublished\":\"2021-05-06T22:00:00+00:00\",\"dateModified\":\"2025-12-08T08:20:44+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ouidou.fr\\\/blog\\\/articles-techniques\\\/webpacker-the-highway-to-hell\"},\"wordCount\":1049,\"publisher\":{\"@id\":\"https:\\\/\\\/ouidou.fr\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/ouidou.fr\\\/blog\\\/articles-techniques\\\/webpacker-the-highway-to-hell#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/ouidou.fr\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/Webpacker-the-highway-to-hell.png\",\"articleSection\":[\"Articles Techniques\"],\"inLanguage\":\"fr-FR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ouidou.fr\\\/blog\\\/articles-techniques\\\/webpacker-the-highway-to-hell\",\"url\":\"https:\\\/\\\/ouidou.fr\\\/blog\\\/articles-techniques\\\/webpacker-the-highway-to-hell\",\"name\":\"Webpacker : the highway to hell - Ouidou\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ouidou.fr\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/ouidou.fr\\\/blog\\\/articles-techniques\\\/webpacker-the-highway-to-hell#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/ouidou.fr\\\/blog\\\/articles-techniques\\\/webpacker-the-highway-to-hell#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/ouidou.fr\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/Webpacker-the-highway-to-hell.png\",\"datePublished\":\"2021-05-06T22:00:00+00:00\",\"dateModified\":\"2025-12-08T08:20:44+00:00\",\"description\":\"Nos experts analysent Webpacker et ses d\u00e9fis : comprendre pourquoi il peut transformer vos projets en cauchemar.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ouidou.fr\\\/blog\\\/articles-techniques\\\/webpacker-the-highway-to-hell#breadcrumb\"},\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/ouidou.fr\\\/blog\\\/articles-techniques\\\/webpacker-the-highway-to-hell\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\\\/\\\/ouidou.fr\\\/blog\\\/articles-techniques\\\/webpacker-the-highway-to-hell#primaryimage\",\"url\":\"https:\\\/\\\/ouidou.fr\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/Webpacker-the-highway-to-hell.png\",\"contentUrl\":\"https:\\\/\\\/ouidou.fr\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/Webpacker-the-highway-to-hell.png\",\"width\":1105,\"height\":564},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ouidou.fr\\\/blog\\\/articles-techniques\\\/webpacker-the-highway-to-hell#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\\\/\\\/ouidou.fr\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Webpacker : the highway to hell\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/ouidou.fr\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/ouidou.fr\\\/blog\\\/\",\"name\":\"Blog Ouidou\",\"description\":\"Conseil et expertise en technologies\",\"publisher\":{\"@id\":\"https:\\\/\\\/ouidou.fr\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/ouidou.fr\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"fr-FR\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/ouidou.fr\\\/blog\\\/#organization\",\"name\":\"Ouidou\",\"url\":\"https:\\\/\\\/ouidou.fr\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\\\/\\\/ouidou.fr\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/ouidou.fr\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/04\\\/image_2022-04-13_150237378.png\",\"contentUrl\":\"https:\\\/\\\/ouidou.fr\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/04\\\/image_2022-04-13_150237378.png\",\"width\":180,\"height\":180,\"caption\":\"Ouidou\"},\"image\":{\"@id\":\"https:\\\/\\\/ouidou.fr\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/ouidou.fr\\\/blog\\\/#\\\/schema\\\/person\\\/e1d66085fb7c22ede319ce56adc373a4\",\"name\":\"Sara Lourties\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b2ef32f9fc1e16168b39587a2ec1dafedc70a9d41fa1b4a930ec7744b3e35ec7?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b2ef32f9fc1e16168b39587a2ec1dafedc70a9d41fa1b4a930ec7744b3e35ec7?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b2ef32f9fc1e16168b39587a2ec1dafedc70a9d41fa1b4a930ec7744b3e35ec7?s=96&d=mm&r=g\",\"caption\":\"Sara Lourties\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Webpacker : the highway to hell - Ouidou","description":"Nos experts analysent Webpacker et ses d\u00e9fis : comprendre pourquoi il peut transformer vos projets en cauchemar.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ouidou.fr\/blog\/articles-techniques\/webpacker-the-highway-to-hell","og_locale":"fr_FR","og_type":"article","og_title":"Webpacker : the highway to hell - Ouidou","og_description":"Nos experts analysent Webpacker et ses d\u00e9fis : comprendre pourquoi il peut transformer vos projets en cauchemar.","og_url":"https:\/\/ouidou.fr\/blog\/articles-techniques\/webpacker-the-highway-to-hell","og_site_name":"Ouidou","article_published_time":"2021-05-06T22:00:00+00:00","article_modified_time":"2025-12-08T08:20:44+00:00","og_image":[{"width":1105,"height":564,"url":"https:\/\/ouidou.fr\/blog\/wp-content\/uploads\/2021\/05\/Webpacker-the-highway-to-hell.png","type":"image\/png"}],"author":"Sara Lourties","twitter_card":"summary_large_image","twitter_misc":{"\u00c9crit par":"Sara Lourties","Dur\u00e9e de lecture estim\u00e9e":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ouidou.fr\/blog\/articles-techniques\/webpacker-the-highway-to-hell#article","isPartOf":{"@id":"https:\/\/ouidou.fr\/blog\/articles-techniques\/webpacker-the-highway-to-hell"},"author":{"name":"Sara Lourties","@id":"https:\/\/ouidou.fr\/blog\/#\/schema\/person\/e1d66085fb7c22ede319ce56adc373a4"},"headline":"Webpacker : the highway to hell","datePublished":"2021-05-06T22:00:00+00:00","dateModified":"2025-12-08T08:20:44+00:00","mainEntityOfPage":{"@id":"https:\/\/ouidou.fr\/blog\/articles-techniques\/webpacker-the-highway-to-hell"},"wordCount":1049,"publisher":{"@id":"https:\/\/ouidou.fr\/blog\/#organization"},"image":{"@id":"https:\/\/ouidou.fr\/blog\/articles-techniques\/webpacker-the-highway-to-hell#primaryimage"},"thumbnailUrl":"https:\/\/ouidou.fr\/blog\/wp-content\/uploads\/2021\/05\/Webpacker-the-highway-to-hell.png","articleSection":["Articles Techniques"],"inLanguage":"fr-FR"},{"@type":"WebPage","@id":"https:\/\/ouidou.fr\/blog\/articles-techniques\/webpacker-the-highway-to-hell","url":"https:\/\/ouidou.fr\/blog\/articles-techniques\/webpacker-the-highway-to-hell","name":"Webpacker : the highway to hell - Ouidou","isPartOf":{"@id":"https:\/\/ouidou.fr\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ouidou.fr\/blog\/articles-techniques\/webpacker-the-highway-to-hell#primaryimage"},"image":{"@id":"https:\/\/ouidou.fr\/blog\/articles-techniques\/webpacker-the-highway-to-hell#primaryimage"},"thumbnailUrl":"https:\/\/ouidou.fr\/blog\/wp-content\/uploads\/2021\/05\/Webpacker-the-highway-to-hell.png","datePublished":"2021-05-06T22:00:00+00:00","dateModified":"2025-12-08T08:20:44+00:00","description":"Nos experts analysent Webpacker et ses d\u00e9fis : comprendre pourquoi il peut transformer vos projets en cauchemar.","breadcrumb":{"@id":"https:\/\/ouidou.fr\/blog\/articles-techniques\/webpacker-the-highway-to-hell#breadcrumb"},"inLanguage":"fr-FR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ouidou.fr\/blog\/articles-techniques\/webpacker-the-highway-to-hell"]}]},{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/ouidou.fr\/blog\/articles-techniques\/webpacker-the-highway-to-hell#primaryimage","url":"https:\/\/ouidou.fr\/blog\/wp-content\/uploads\/2021\/05\/Webpacker-the-highway-to-hell.png","contentUrl":"https:\/\/ouidou.fr\/blog\/wp-content\/uploads\/2021\/05\/Webpacker-the-highway-to-hell.png","width":1105,"height":564},{"@type":"BreadcrumbList","@id":"https:\/\/ouidou.fr\/blog\/articles-techniques\/webpacker-the-highway-to-hell#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/ouidou.fr\/blog\/"},{"@type":"ListItem","position":2,"name":"Webpacker : the highway to hell"}]},{"@type":"WebSite","@id":"https:\/\/ouidou.fr\/blog\/#website","url":"https:\/\/ouidou.fr\/blog\/","name":"Blog Ouidou","description":"Conseil et expertise en technologies","publisher":{"@id":"https:\/\/ouidou.fr\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ouidou.fr\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"fr-FR"},{"@type":"Organization","@id":"https:\/\/ouidou.fr\/blog\/#organization","name":"Ouidou","url":"https:\/\/ouidou.fr\/blog\/","logo":{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/ouidou.fr\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/ouidou.fr\/blog\/wp-content\/uploads\/2022\/04\/image_2022-04-13_150237378.png","contentUrl":"https:\/\/ouidou.fr\/blog\/wp-content\/uploads\/2022\/04\/image_2022-04-13_150237378.png","width":180,"height":180,"caption":"Ouidou"},"image":{"@id":"https:\/\/ouidou.fr\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/ouidou.fr\/blog\/#\/schema\/person\/e1d66085fb7c22ede319ce56adc373a4","name":"Sara Lourties","image":{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/secure.gravatar.com\/avatar\/b2ef32f9fc1e16168b39587a2ec1dafedc70a9d41fa1b4a930ec7744b3e35ec7?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/b2ef32f9fc1e16168b39587a2ec1dafedc70a9d41fa1b4a930ec7744b3e35ec7?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b2ef32f9fc1e16168b39587a2ec1dafedc70a9d41fa1b4a930ec7744b3e35ec7?s=96&d=mm&r=g","caption":"Sara Lourties"}}]}},"_links":{"self":[{"href":"https:\/\/ouidou.fr\/blog\/wp-json\/wp\/v2\/posts\/7905","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ouidou.fr\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ouidou.fr\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ouidou.fr\/blog\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/ouidou.fr\/blog\/wp-json\/wp\/v2\/comments?post=7905"}],"version-history":[{"count":4,"href":"https:\/\/ouidou.fr\/blog\/wp-json\/wp\/v2\/posts\/7905\/revisions"}],"predecessor-version":[{"id":17995,"href":"https:\/\/ouidou.fr\/blog\/wp-json\/wp\/v2\/posts\/7905\/revisions\/17995"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ouidou.fr\/blog\/wp-json\/wp\/v2\/media\/12490"}],"wp:attachment":[{"href":"https:\/\/ouidou.fr\/blog\/wp-json\/wp\/v2\/media?parent=7905"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ouidou.fr\/blog\/wp-json\/wp\/v2\/categories?post=7905"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ouidou.fr\/blog\/wp-json\/wp\/v2\/tags?post=7905"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}