From 660c436158faf3b70c4ed904c72fafba3485b33b Mon Sep 17 00:00:00 2001 From: mama Date: Mon, 5 Feb 2018 18:17:56 +0100 Subject: [PATCH] =?UTF-8?q?:racehorse:=20Utilisation=20de=20file-loader=20?= =?UTF-8?q?plut=C3=B4t=20que=20url-loader?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Nous avons peu d'images, aucune petite, et elles sont sur des pages bien particulières : mieux vaut les exclure du bundle.js. Pas besoin de les optimiser non plus pour le moment pour les mêmes raisons. --- package.json | 2 +- source/webpack.config.js | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 6104ac605..614dd6215 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "fantasy-combinators": "0.0.1", "fantasy-land": "^3.3.0", "fantasy-tuples": "^1.0.0", - "file-loader": "^1.1.5", + "file-loader": "^1.1.6", "html-loader": "^0.5.1", "img-loader": "^2.0.0", "jsdom": "^11.0.0", diff --git a/source/webpack.config.js b/source/webpack.config.js index 7bb8e3a7e..7e902551a 100644 --- a/source/webpack.config.js +++ b/source/webpack.config.js @@ -55,6 +55,15 @@ module.exports = { test: /\.html$/, loader: 'html-loader' }, + { + test: /\.(jpe?g|png|svg)$/, + use: { + loader: 'file-loader', + options: { + name: 'images/[name].[ext]' + } + } + }, { test: /\.yaml$/, loader: 'json-loader!yaml-loader' @@ -73,12 +82,6 @@ module.exports = { skipEmptyLines: true } }, - { - test: /\.(jpe?g|png|gif|svg)$/i, - loader: prodEnv - ? 'url-loader?limit=10000&name=images/[name].[ext]!img-loader?progressive=true' - : 'url-loader?limit=10000&name=images/[name].[ext]' - }, { test: /\.ne$/, loader: 'babel-loader!nearley-loader'