Fix common CSS.

This commit is contained in:
Tomasz Drwięga 2018-03-12 22:24:59 +01:00
parent e65fc23bc5
commit 41c21d2b3b
No known key found for this signature in database
GPG Key ID: D066F497E62CAF66
2 changed files with 98 additions and 97 deletions

View File

@ -19,6 +19,7 @@ const fs = require('fs');
const path = require('path');
const rimraf = require('rimraf');
const flatten = require('lodash.flatten');
const webpack = require('webpack');
// const ReactIntlAggregatePlugin = require('react-intl-aggregate-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const WebpackErrorNotificationPlugin = require('webpack-error-notification');
@ -165,17 +166,16 @@ module.exports = {
},
plugins: (function () {
let plugins = Shared.getPlugins(isProd, true).concat(
let plugins = []
.concat(Shared.getPlugins(isProd, true))
.concat(
new WebpackErrorNotificationPlugin(),
new ExtractTextPlugin({
filename: 'bundle.css',
filename: '[name].css',
allChunks: true
}),
);
plugins = [].concat(
plugins,
})
)
.concat(
new HtmlWebpackPlugin({
title: 'Parity Bar',
filename: 'embed.html',
@ -256,6 +256,14 @@ module.exports = {
)
);
if (isProd) {
plugins.unshift(
new webpack.optimize.CommonsChunkPlugin({
name: 'commons'
})
);
}
return plugins;
}())
};

View File

@ -33,7 +33,7 @@ const UI_VERSION = PackageJson
})
.join('.');
function getPlugins (_isProd = isProd, withCommons = false) {
function getPlugins (_isProd = isProd) {
const plugins = [
new webpack.DefinePlugin({
'process.env': {
@ -53,13 +53,6 @@ function getPlugins (_isProd = isProd, withCommons = false) {
];
if (_isProd) {
if (withCommons) {
plugins.push(
new webpack.optimize.CommonsChunkPlugin({
name: 'commons'
})
)
}
plugins.push(
new webpack.optimize.ModuleConcatenationPlugin(),
new webpack.optimize.UglifyJsPlugin({