X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=app%2Fconfig%2Fwebpack%2Fprod.js;h=17b8c38429d90517810fce8444dadb1d9d3bc260;hb=8f2038e5b15c2d7342ed18381531e5eb95e86d46;hp=ef41ab990c16d32586722434001c983f8a78a2de;hpb=4ab0d25f652bdfe184046be6d50afd594709e1a9;p=github%2Fwallabag%2Fwallabag.git diff --git a/app/config/webpack/prod.js b/app/config/webpack/prod.js index ef41ab99..17b8c384 100644 --- a/app/config/webpack/prod.js +++ b/app/config/webpack/prod.js @@ -5,34 +5,34 @@ const ManifestPlugin = require('webpack-manifest-plugin'); const commonConfig = require('./common.js'); -module.exports = function() { +module.exports = function () { return webpackMerge(commonConfig(), { output: { - filename: '[name].js' + filename: '[name].js', }, devtool: 'source-map', plugins: [ new webpack.DefinePlugin({ 'process.env': { - 'NODE_ENV': JSON.stringify('production') - } + 'NODE_ENV': JSON.stringify('production'), + }, }), new webpack.optimize.UglifyJsPlugin({ beautify: false, mangle: { screw_ie8: true, - keep_fnames: true + keep_fnames: true, }, compress: { screw_ie8: true, - warnings: false + warnings: false, }, - comments: false + comments: false, }), new ExtractTextPlugin('[name].css'), new ManifestPlugin({ fileName: 'manifest.json', - }) + }), ], module: { rules: [ @@ -48,9 +48,9 @@ module.exports = function() { use: { loader: 'babel-loader', options: { - presets: ['env'] - } - } + presets: ['env'], + }, + }, }, { test: /\.(s)?css$/, @@ -63,26 +63,38 @@ module.exports = function() { importLoaders: 1, minimize: { discardComments: { - removeAll: true + removeAll: true, }, core: true, - minifyFontValues: true - } - } + minifyFontValues: true, + }, + }, }, 'postcss-loader', - 'sass-loader' - ] - }) + 'sass-loader', + ], + }), }, { - test: /\.(jpg|png|gif|svg)$/, + test: /\.(jpg|png|gif|svg|ico)$/, + include: /node_modules/, use: { loader: 'file-loader', options: { name: 'img/[name].[ext]', - } - } + }, + }, + }, + { + test: /\.(jpg|png|gif|svg|ico)$/, + exclude: /node_modules/, + use: { + loader: 'file-loader', + options: { + context: 'app/Resources/static', + name: '[path][name].[ext]', + }, + }, }, { test: /\.(eot|ttf|woff|woff2)$/, @@ -90,10 +102,10 @@ module.exports = function() { loader: 'file-loader', options: { name: 'fonts/[name].[ext]', - } - } - } - ] + }, + }, + }, + ], }, - }) + }); };