Commit c1e447d0 authored by Andrew Hrdy's avatar Andrew Hrdy
Browse files

Favicon and manifest now copy to the build directory.

parent 7e494d14
Pipeline #2485 failed with stage
in 52 seconds
...@@ -13,6 +13,8 @@ import {MuiThemeProvider} from 'material-ui/styles'; ...@@ -13,6 +13,8 @@ import {MuiThemeProvider} from 'material-ui/styles';
import theme from './theme'; import theme from './theme';
import './styles/whatsOpen.scss'; import './styles/whatsOpen.scss';
import 'typeface-roboto'; import 'typeface-roboto';
import '../public/manifest.json';
import '../public/favicon.png';
// Create a history of your choosing (we're using a browser history in this case) // Create a history of your choosing (we're using a browser history in this case)
const history = createHistory(); const history = createHistory();
......
...@@ -19,7 +19,7 @@ const postCssLoader = { ...@@ -19,7 +19,7 @@ const postCssLoader = {
options: { options: {
plugins: () => [require('autoprefixer')] plugins: () => [require('autoprefixer')]
} }
} };
const cssLoader = { const cssLoader = {
test: /\.css$/, test: /\.css$/,
...@@ -28,7 +28,7 @@ const cssLoader = { ...@@ -28,7 +28,7 @@ const cssLoader = {
'css-loader', 'css-loader',
postCssLoader postCssLoader
] ]
} };
const scssLoader = { const scssLoader = {
test: /\.scss$/, test: /\.scss$/,
...@@ -38,7 +38,7 @@ const scssLoader = { ...@@ -38,7 +38,7 @@ const scssLoader = {
postCssLoader, postCssLoader,
'sass-loader' 'sass-loader'
] ]
} };
const cssExtractLoader = { const cssExtractLoader = {
test: /\.css$/, test: /\.css$/,
...@@ -47,17 +47,17 @@ const cssExtractLoader = { ...@@ -47,17 +47,17 @@ const cssExtractLoader = {
'css-loader', 'css-loader',
postCssLoader postCssLoader
] ]
} };
const scssExtractLoader = { const scssExtractLoader = {
test: /\.scss$/, test: /\.scss$/,
use: [ use: [
MiniCssExtractPlugin.loader, MiniCssExtractPlugin.loader,
"css-loader", 'css-loader',
postCssLoader, postCssLoader,
"sass-loader" 'sass-loader'
] ]
} };
const fileLoader = { const fileLoader = {
exclude: [ exclude: [
...@@ -75,7 +75,16 @@ const fileLoader = { ...@@ -75,7 +75,16 @@ const fileLoader = {
options: { options: {
name: 'static/media/[name].[hash:8].[ext]' name: 'static/media/[name].[hash:8].[ext]'
} }
} };
const publicFileLoader = {
type: 'javascript/auto',
test: /\.(png|json)$/,
loader: 'file-loader',
options: {
name: '[name].[ext]'
}
};
module.exports = { module.exports = {
eslintLoader: eslintLoader, eslintLoader: eslintLoader,
...@@ -84,5 +93,6 @@ module.exports = { ...@@ -84,5 +93,6 @@ module.exports = {
scssLoader: scssLoader, scssLoader: scssLoader,
cssExtractLoader: cssExtractLoader, cssExtractLoader: cssExtractLoader,
scssExtractLoader: scssExtractLoader, scssExtractLoader: scssExtractLoader,
fileLoader: fileLoader fileLoader: fileLoader,
} publicFileLoader: publicFileLoader
\ No newline at end of file };
\ No newline at end of file
...@@ -22,7 +22,8 @@ module.exports = { ...@@ -22,7 +22,8 @@ module.exports = {
loaders.babelLoader, loaders.babelLoader,
loaders.cssLoader, loaders.cssLoader,
loaders.scssLoader, loaders.scssLoader,
loaders.fileLoader loaders.fileLoader,
loaders.publicFileLoader
] ]
}, },
plugins: [ plugins: [
......
...@@ -4,7 +4,6 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin'); ...@@ -4,7 +4,6 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin'); const CleanWebpackPlugin = require('clean-webpack-plugin');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin'); const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const webpack = require('webpack');
const paths = require('./paths'); const paths = require('./paths');
const loaders = require('./loaders'); const loaders = require('./loaders');
...@@ -27,7 +26,8 @@ module.exports = { ...@@ -27,7 +26,8 @@ module.exports = {
loaders.babelLoader, loaders.babelLoader,
loaders.cssExtractLoader, loaders.cssExtractLoader,
loaders.scssExtractLoader, loaders.scssExtractLoader,
loaders.fileLoader loaders.fileLoader,
loaders.publicFileLoader
] ]
}, },
optimization: { optimization: {
...@@ -54,7 +54,7 @@ module.exports = { ...@@ -54,7 +54,7 @@ module.exports = {
keepClosingSlash: true, keepClosingSlash: true,
minifyJS: true, minifyJS: true,
minifyCSS: true, minifyCSS: true,
minifyURLs: true, minifyURLs: true
} }
}), }),
new SWPrecacheWebpackPlugin({ new SWPrecacheWebpackPlugin({
...@@ -70,9 +70,9 @@ module.exports = { ...@@ -70,9 +70,9 @@ module.exports = {
console.log(message); console.log(message);
}, },
minify: true, minify: true,
navigateFallback: paths.publicUrl + '/index.html', navigateFallback: `${paths.publicUrl}/index.html`,
navigateFallbackWhitelist: [/^(?!\/__).*/], navigateFallbackWhitelist: [/^(?!\/__).*/],
staticFileGlobsIgnorePatterns: [/\.map$/, /asset-manifest\.json$/], staticFileGlobsIgnorePatterns: [/\.map$/, /asset-manifest\.json$/]
}), }),
new MiniCssExtractPlugin({ new MiniCssExtractPlugin({
filename: '[name].css', filename: '[name].css',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment