Skip to content
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.

Commit

Permalink
feat(client/prod): remove favicons/preload/babili/sri/html plugins
Browse files Browse the repository at this point in the history
feat(client/prod): remove favicons/preload/babili/sri/html plugins
  • Loading branch information
Metnew committed Sep 6, 2017
1 parent 952b6e6 commit 1f2815e
Showing 1 changed file with 1 addition and 50 deletions.
51 changes: 1 addition & 50 deletions webpack_config/client/webpack.prod.babel.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
import webpack from 'webpack'
import ExtractTextPlugin from 'extract-text-webpack-plugin'
import HtmlWebpackPlugin from 'html-webpack-plugin'
import SriPlugin from 'webpack-subresource-integrity'
import CompressionPlugin from 'compression-webpack-plugin'
import OptimizeCssAssetsPlugin from 'optimize-css-assets-webpack-plugin'
// import BabiliPlugin = require('babili-webpack-plugin'
import AutoDllPlugin from 'autodll-webpack-plugin'
import ProgressPlugin from 'webpack/lib/ProgressPlugin'
import OfflinePlugin from 'offline-plugin'
import PreloadWebpackPlugin from 'preload-webpack-plugin'
import FaviconsWebpackPlugin from 'favicons-webpack-plugin'
import UglifyJSPlugin from 'uglifyjs-webpack-plugin'
import {Plugin as ShakePlugin} from 'webpack-common-shake'
import OptimizeJsPlugin from 'optimize-js-plugin'
Expand All @@ -21,15 +16,13 @@ import path from 'path'
import {BundleAnalyzerPlugin} from 'webpack-bundle-analyzer'
import base from './webpack.base'
import config from '../config'
//
const {ANALYZE_BUNDLE} = config

// NOTE: you can track versions with gitHash and store your build
// in dist folder with path like: /dist/client/<gitHash>/{yourFilesHere}
// const gitHash = git.short()

// Do you want to use bundle analyzer?
if (ANALYZE_BUNDLE) {
if (config.ANALYZE_BUNDLE) {
base.plugins.push(new BundleAnalyzerPlugin({analyzerMode: 'static'}))
}

Expand Down Expand Up @@ -118,48 +111,6 @@ base.plugins.push(
new webpack.optimize.CommonsChunkPlugin({
name: 'manifest'
}),
// NOTE: this plugin is good, but there are few big issues:
// 1. It sets invalid url to browserconfig.xml and manifest.json in index.html.
// E.g: in generated index.html you can see:
// <meta name="msapplication-config" content="browserconfig.xml">
// 2. It looks like generated images aren't minified.(not sure)
// 3. plugin is deprecated (at least look like it's deprecated)!
// NOTE: It would be better to generate favicons without this plugin.
new FaviconsWebpackPlugin({
// add theme-color property
background: config.manifest.theme,
prefix: `favicons/`,
logo: path.resolve(config.rootPath, './static/images/logo.png'),
title: config.title,
// Inject the html into the html-webpack-plugin
inject: false,
// which icons should be generated (see https://github.com/haydenbleasel/favicons#usage)
icons: {
android: true,
appleIcon: true,
appleStartup: true,
coast: false,
favicons: true,
firefox: true,
opengraph: false,
twitter: true,
yandex: false,
windows: true
}
}),
//
// generate <link rel="preload"> tags for async chunks
new PreloadWebpackPlugin({
rel: 'preload',
as: 'script',
include: 'asyncChunks'
}),
// https://caniuse.com/#feat=subresource-integrity
// NOTE: please, read about SRI before using it!
new SriPlugin({
hashFuncNames: ['sha256', 'sha384'],
enabled: true
}),
new CompressionPlugin({
algorithm: 'gzip'
}),
Expand Down

0 comments on commit 1f2815e

Please sign in to comment.