2017-06-25 13:13:39 -05:00
|
|
|
import webpack from 'webpack';
|
|
|
|
import HTMLWebpackPlugin from 'html-webpack-plugin';
|
|
|
|
import FriendlyErrorsPlugin from 'friendly-errors-webpack-plugin';
|
2017-07-13 16:28:45 -05:00
|
|
|
import baseConfig from './webpack.config';
|
2017-07-15 14:58:05 -05:00
|
|
|
import env from '../src/config/env';
|
2017-07-22 10:34:29 -05:00
|
|
|
import StyleLintPlugin from 'stylelint-webpack-plugin';
|
2018-06-25 02:45:57 -05:00
|
|
|
import getPackageJson from './getPackageJson';
|
2017-06-25 13:13:39 -05:00
|
|
|
|
|
|
|
export default {
|
|
|
|
...baseConfig,
|
2018-04-26 22:52:24 -05:00
|
|
|
|
|
|
|
mode: 'development',
|
|
|
|
|
2017-06-25 13:13:39 -05:00
|
|
|
entry: {
|
|
|
|
main: [
|
2018-03-20 01:21:54 -05:00
|
|
|
'whatwg-fetch',
|
2017-06-25 13:13:39 -05:00
|
|
|
'react-hot-loader/patch',
|
|
|
|
'webpack-dev-server/client?http://localhost:4872',
|
|
|
|
'webpack/hot/only-dev-server',
|
2018-07-17 14:22:44 -05:00
|
|
|
`${env.SRC_ROOT}/webui/index.js`,
|
2017-07-15 15:04:58 -05:00
|
|
|
],
|
2017-06-25 13:13:39 -05:00
|
|
|
},
|
|
|
|
|
|
|
|
output: {
|
|
|
|
...baseConfig.output,
|
2017-07-15 15:04:58 -05:00
|
|
|
publicPath: '/',
|
2017-06-25 13:13:39 -05:00
|
|
|
},
|
|
|
|
|
2018-03-20 01:21:54 -05:00
|
|
|
devtool: 'cheap-module-eval-source-map',
|
|
|
|
|
2017-06-25 13:13:39 -05:00
|
|
|
plugins: [
|
|
|
|
new webpack.DefinePlugin({
|
2018-02-19 13:29:14 -05:00
|
|
|
__DEBUG__: true,
|
2018-06-25 02:45:57 -05:00
|
|
|
__APP_VERSION__: `"${getPackageJson('version')}"`,
|
2017-06-25 13:13:39 -05:00
|
|
|
}),
|
|
|
|
new HTMLWebpackPlugin({
|
2019-01-20 13:25:50 -05:00
|
|
|
title: 'Verdaccio Dev UI',
|
2018-07-29 11:30:08 -05:00
|
|
|
scope: '',
|
2019-01-20 14:10:39 -05:00
|
|
|
logo: 'https://verdaccio.org/img/logo/symbol/svg/verdaccio-tiny.svg',
|
2017-06-25 13:13:39 -05:00
|
|
|
filename: 'index.html',
|
2017-07-09 10:44:11 -05:00
|
|
|
verdaccioURL: '//localhost:4873',
|
2017-07-13 12:55:19 -05:00
|
|
|
template: `${env.SRC_ROOT}/webui/template/index.html`,
|
2017-06-25 13:13:39 -05:00
|
|
|
debug: true,
|
|
|
|
inject: true,
|
|
|
|
}),
|
|
|
|
new webpack.HotModuleReplacementPlugin(),
|
|
|
|
new webpack.NoEmitOnErrorsPlugin(),
|
2017-07-15 15:04:58 -05:00
|
|
|
new FriendlyErrorsPlugin(),
|
2017-07-22 10:34:29 -05:00
|
|
|
new StyleLintPlugin({
|
2018-12-15 03:40:43 -05:00
|
|
|
files: ['src/webui/**/styles.js'],
|
2017-07-22 10:34:29 -05:00
|
|
|
failOnError: false,
|
2018-12-15 03:40:43 -05:00
|
|
|
emitErrors: false
|
2017-07-22 10:34:29 -05:00
|
|
|
}),
|
2017-07-15 15:04:58 -05:00
|
|
|
],
|
2017-07-13 16:28:45 -05:00
|
|
|
};
|