From 93be0e4926595dcbd4cfed2dd2ec4d1ba8e4216c Mon Sep 17 00:00:00 2001 From: Geoffroy Warin Date: Wed, 4 May 2016 13:53:29 +0200 Subject: [PATCH] Fix node env and add hashes for fonts --- lib/loaders/fonts.js | 10 +++++----- lib/tasks/build.js | 2 +- lib/tasks/start.js | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/loaders/fonts.js b/lib/loaders/fonts.js index 323ecba..b0cfed0 100644 --- a/lib/loaders/fonts.js +++ b/lib/loaders/fonts.js @@ -3,7 +3,7 @@ module.exports = [ test: /\.woff(\?.*)?$/, loader: 'url', query: { - name: 'fonts/[name].[ext]', + name: 'fonts/[name]-[hash].[ext]', limit: 10000, mimetype: 'application/font-woff' } @@ -12,7 +12,7 @@ module.exports = [ test: /\.woff2(\?.*)?$/, loader: 'url', query: { - name: 'fonts/[name].[ext]', + name: 'fonts/[name]-[hash].[ext]', limit: 10000, mimetype: 'application/font-woff2' } @@ -21,7 +21,7 @@ module.exports = [ test: /\.ttf(\?.*)?$/, loader: 'url', query: { - name: 'fonts/[name].[ext]', + name: 'fonts/[name]-[hash].[ext]', limit: 10000, mimetype: 'application/octet-stream' } @@ -30,14 +30,14 @@ module.exports = [ test: /\.eot(\?.*)?$/, loader: 'file', query: { - name: 'fonts/[name].[ext]' + name: 'fonts/[name]-[hash].[ext]' } }, { test: /\.svg(\?.*)?$/, loader: 'url', query: { - name: 'fonts/[name].[ext]', + name: 'fonts/[name]-[hash].[ext]', limit: 10000, mimetype: 'image/svg+xml' } diff --git a/lib/tasks/build.js b/lib/tasks/build.js index 42f4142..7ca747b 100644 --- a/lib/tasks/build.js +++ b/lib/tasks/build.js @@ -1,7 +1,7 @@ const webpack = require('webpack'); module.exports = function build(options) { - process.env['NODE_ENV'] = JSON.stringify('production'); + process.env['NODE_ENV'] = 'production'; const config = require('../webpack/webpack.prod.config')(options); webpack(config, (error, stats) => { if (error) { diff --git a/lib/tasks/start.js b/lib/tasks/start.js index 64e26da..e0268a2 100644 --- a/lib/tasks/start.js +++ b/lib/tasks/start.js @@ -6,7 +6,7 @@ const proxy = require('http-proxy-middleware'); const makeConfig = require('../webpack/webpack.dev.config'); module.exports = function start (options) { - process.env['NODE_ENV'] = JSON.stringify('development'); + process.env['NODE_ENV'] = 'development'; const app = express(); const config = makeConfig(options);