Fix common CSS.
This commit is contained in:
parent
e65fc23bc5
commit
41c21d2b3b
@ -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;
|
||||
}())
|
||||
};
|
||||
|
@ -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({
|
||||
|
Loading…
Reference in New Issue
Block a user