diff --git a/.gitignore b/.gitignore index b428f831..a2a4695d 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,7 @@ cellxgene/ server/app/web/static/css/ server/app/web/static/img/ server/app/web/static/media/ +server/app/web/static/fonts/ server/app/web/static/js/ server/app/web/templates/index\.html diff --git a/client/configuration/webpack/webpack.config.dev.js b/client/configuration/webpack/webpack.config.dev.js index 7f8e7bc6..8dba0615 100644 --- a/client/configuration/webpack/webpack.config.dev.js +++ b/client/configuration/webpack/webpack.config.dev.js @@ -4,6 +4,7 @@ const webpack = require("webpack"); const HtmlWebpackPlugin = require("html-webpack-plugin"); const src = path.resolve("src"); +const fonts = path.resolve("src/fonts"); const nodeModules = path.resolve("node_modules"); const babelOptions = require("../babel/babel.dev"); @@ -60,10 +61,16 @@ module.exports = { { test: /\.json$/, include: [src, nodeModules], loader: "json-loader" }, { test: /\.(jpg|png|gif|eot|svg|ttf|woff|woff2)(\?.*)?$/, - include: [src, nodeModules], + include: nodeModules, loader: "file-loader", query: { name: "static/media/[name].[ext]" } }, + { + test: /\.(woff|woff2|eot|ttf|otf)$/, + include: fonts, + loader: "file-loader", + query: { name: "static/fonts/[name].[ext]" } + }, { test: /\.(mp4|webm)(\?.*)?$/, include: [src, nodeModules], diff --git a/client/configuration/webpack/webpack.config.prod.js b/client/configuration/webpack/webpack.config.prod.js index ce027e5e..8ee88746 100644 --- a/client/configuration/webpack/webpack.config.prod.js +++ b/client/configuration/webpack/webpack.config.prod.js @@ -6,6 +6,7 @@ const SWPrecacheWebpackPlugin = require("sw-precache-webpack-plugin"); const HtmlWebpackInlineSourcePlugin = require("html-webpack-inline-source-plugin"); const src = path.resolve("src"); +const fonts = path.resolve("src/fonts"); const nodeModules = path.resolve("node_modules"); const babelOptions = require("../babel/babel.prod"); @@ -69,12 +70,15 @@ module.exports = { }, { test: /\.(jpg|png|gif|eot|svg|ttf|woff|woff2)(\?.*)?$/, - include: [src, nodeModules], + include: nodeModules, loader: "file-loader", - options: { - name: "[name].[hash:8].[ext]", - outputPath: "static/media/" - } + query: { name: "static/media/[name].[ext]" } + }, + { + test: /\.(woff|woff2|eot|ttf|otf)$/, + include: fonts, + loader: "file-loader", + query: { name: "static/fonts/[name].[ext]" } }, { test: /\.(mp4|webm)(\?.*)?$/, diff --git a/client/index.html b/client/index.html index 98341fbe..134e38c9 100644 --- a/client/index.html +++ b/client/index.html @@ -4,7 +4,6 @@