2017-06-25 13:13:39 -05:00
|
|
|
import webpack from 'webpack';
|
|
|
|
import HTMLWebpackPlugin from 'html-webpack-plugin';
|
|
|
|
import ExtractTextPlugin from 'extract-text-webpack-plugin';
|
|
|
|
import baseConfig from './webpack.config'
|
|
|
|
import env from '../../config/env'
|
|
|
|
import _ from 'lodash'
|
|
|
|
|
|
|
|
baseConfig.module.rules
|
|
|
|
.filter(loader =>
|
|
|
|
Array.isArray(loader.use) && loader.use.find(v => /css/.test(v.loader.split('-')[0]))
|
|
|
|
).forEach(loader => {
|
|
|
|
loader.use = ExtractTextPlugin.extract({
|
|
|
|
fallback: 'style-loader',
|
|
|
|
use: _.tail(loader.use)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
export default {
|
|
|
|
...baseConfig,
|
|
|
|
entry: {
|
|
|
|
main: `${env.SRC_ROOT}/webui/src/index.jsx`
|
|
|
|
},
|
|
|
|
|
|
|
|
output: {
|
2017-07-09 12:32:09 -05:00
|
|
|
...baseConfig.output
|
2017-06-25 13:13:39 -05:00
|
|
|
},
|
|
|
|
|
|
|
|
plugins: [
|
|
|
|
new webpack.DefinePlugin({
|
|
|
|
__DEBUG__: false,
|
|
|
|
'process.env.NODE_ENV': '"production"'
|
|
|
|
}),
|
|
|
|
new webpack.optimize.UglifyJsPlugin({
|
|
|
|
sourceMap: true,
|
|
|
|
compress: {
|
|
|
|
warnings: false
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
new ExtractTextPlugin('style.[contenthash].css'),
|
|
|
|
new HTMLWebpackPlugin({
|
|
|
|
title: 'Verdaccio',
|
|
|
|
filename: 'index.html',
|
|
|
|
verdaccioURL: 'ToReplaceByVerdaccio',
|
2017-07-13 12:55:19 -05:00
|
|
|
template: `${env.SRC_ROOT}/webui/template/index.html`,
|
2017-07-06 09:42:36 -05:00
|
|
|
debug: false,
|
2017-06-25 13:13:39 -05:00
|
|
|
inject: true,
|
|
|
|
}),
|
|
|
|
new webpack.NoEmitOnErrorsPlugin()
|
|
|
|
]
|
|
|
|
}
|