Commit c1e447d0 authored by Andrew Hrdy's avatar Andrew Hrdy

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';
import theme from './theme';
import './styles/whatsOpen.scss';
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)
const history = createHistory();
......
......@@ -19,7 +19,7 @@ const postCssLoader = {
options: {
plugins: () => [require('autoprefixer')]
}
}
};
const cssLoader = {
test: /\.css$/,
......@@ -28,7 +28,7 @@ const cssLoader = {
'css-loader',
postCssLoader
]
}
};
const scssLoader = {
test: /\.scss$/,
......@@ -38,7 +38,7 @@ const scssLoader = {
postCssLoader,
'sass-loader'
]
}
};
const cssExtractLoader = {
test: /\.css$/,
......@@ -47,17 +47,17 @@ const cssExtractLoader = {
'css-loader',
postCssLoader
]
}
};
const scssExtractLoader = {
test: /\.scss$/,
use: [
MiniCssExtractPlugin.loader,
"css-loader",
'css-loader',
postCssLoader,
"sass-loader"
'sass-loader'
]
}
};
const fileLoader = {
exclude: [
......@@ -75,7 +75,16 @@ const fileLoader = {
options: {
name: 'static/media/[name].[hash:8].[ext]'
}
}
};
const publicFileLoader = {
type: 'javascript/auto',
test: /\.(png|json)$/,
loader: 'file-loader',
options: {
name: '[name].[ext]'
}
};
module.exports = {
eslintLoader: eslintLoader,
......@@ -84,5 +93,6 @@ module.exports = {
scssLoader: scssLoader,
cssExtractLoader: cssExtractLoader,
scssExtractLoader: scssExtractLoader,
fileLoader: fileLoader
}
\ No newline at end of file
fileLoader: fileLoader,
publicFileLoader: publicFileLoader
};
\ No newline at end of file
......@@ -22,7 +22,8 @@ module.exports = {
loaders.babelLoader,
loaders.cssLoader,
loaders.scssLoader,
loaders.fileLoader
loaders.fileLoader,
loaders.publicFileLoader
]
},
plugins: [
......
......@@ -4,7 +4,6 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const webpack = require('webpack');
const paths = require('./paths');
const loaders = require('./loaders');
......@@ -27,7 +26,8 @@ module.exports = {
loaders.babelLoader,
loaders.cssExtractLoader,
loaders.scssExtractLoader,
loaders.fileLoader
loaders.fileLoader,
loaders.publicFileLoader
]
},
optimization: {
......@@ -54,7 +54,7 @@ module.exports = {
keepClosingSlash: true,
minifyJS: true,
minifyCSS: true,
minifyURLs: true,
minifyURLs: true
}
}),
new SWPrecacheWebpackPlugin({
......@@ -70,9 +70,9 @@ module.exports = {
console.log(message);
},
minify: true,
navigateFallback: paths.publicUrl + '/index.html',
navigateFallback: `${paths.publicUrl}/index.html`,
navigateFallbackWhitelist: [/^(?!\/__).*/],
staticFileGlobsIgnorePatterns: [/\.map$/, /asset-manifest\.json$/],
staticFileGlobsIgnorePatterns: [/\.map$/, /asset-manifest\.json$/]
}),
new MiniCssExtractPlugin({
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