From 8853b7af04ca7a8ad2b380fc0a61729566596721 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Chopin?= Date: Sun, 11 Jun 2017 21:04:59 +0200 Subject: [PATCH] Remove `build.loaders` option --- lib/webpack/base.config.js | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/lib/webpack/base.config.js b/lib/webpack/base.config.js index faf635ced0..2e0011f0bc 100644 --- a/lib/webpack/base.config.js +++ b/lib/webpack/base.config.js @@ -77,7 +77,23 @@ export default function webpackBaseConfig ({ isClient, isServer }) { { test: /\.less$/, use: styleLoader.call(this, 'less', 'less-loader') }, { test: /\.sass$/, use: styleLoader.call(this, 'sass', 'sass-loader?indentedSyntax&sourceMap') }, { test: /\.scss$/, use: styleLoader.call(this, 'sass', 'sass-loader?sourceMap') }, - { test: /\.styl(us)?$/, use: styleLoader.call(this, 'stylus', 'stylus-loader') } + { test: /\.styl(us)?$/, use: styleLoader.call(this, 'stylus', 'stylus-loader') }, + { + test: /\.(png|jpe?g|gif|svg)$/, + loader: 'url-loader', + query: { + limit: 1000, // 1KO + name: 'img/[name].[hash:7].[ext]' + } + }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + query: { + limit: 1000, // 1 KO + name: 'fonts/[name].[hash:7].[ext]' + } + } ] }, plugins: this.options.build.plugins @@ -88,8 +104,6 @@ export default function webpackBaseConfig ({ isClient, isServer }) { new ExtractTextPlugin({ filename: this.options.build.filenames.css }) ) } - // Add nuxt build loaders (can be configured in nuxt.config.js) - config.module.rules = config.module.rules.concat(this.options.build.loaders) // Return config return config }