2019-04-05 02:23:40 +07:00
|
|
|
import webpack from 'webpack';
|
|
|
|
import HTMLWebpackPlugin from 'html-webpack-plugin';
|
|
|
|
import FriendlyErrorsPlugin from 'friendly-errors-webpack-plugin';
|
|
|
|
import baseConfig from './webpack.config';
|
2019-06-20 19:37:28 +07:00
|
|
|
import env from '../config/env';
|
2019-04-05 02:23:40 +07:00
|
|
|
import StyleLintPlugin from 'stylelint-webpack-plugin';
|
|
|
|
import getPackageJson from './getPackageJson';
|
2019-02-03 17:23:33 +07:00
|
|
|
|
|
|
|
export default {
|
|
|
|
...baseConfig,
|
|
|
|
|
2019-04-05 02:23:40 +07:00
|
|
|
mode: 'development',
|
2019-02-03 17:23:33 +07:00
|
|
|
|
|
|
|
entry: {
|
|
|
|
main: [
|
2019-04-05 02:23:40 +07:00
|
|
|
'whatwg-fetch',
|
|
|
|
'react-hot-loader/patch',
|
|
|
|
'webpack-dev-server/client?http://localhost:4872',
|
|
|
|
'webpack/hot/only-dev-server',
|
2019-06-20 19:37:28 +07:00
|
|
|
`${env.SRC_ROOT}/index.tsx`,
|
2019-04-05 02:23:40 +07:00
|
|
|
],
|
2019-02-03 17:23:33 +07:00
|
|
|
},
|
|
|
|
|
|
|
|
output: {
|
|
|
|
...baseConfig.output,
|
2019-04-05 02:23:40 +07:00
|
|
|
publicPath: '/',
|
2019-02-03 17:23:33 +07:00
|
|
|
},
|
|
|
|
|
2019-04-05 02:23:40 +07:00
|
|
|
devtool: 'cheap-module-eval-source-map',
|
2019-02-03 17:23:33 +07:00
|
|
|
|
|
|
|
plugins: [
|
|
|
|
new webpack.DefinePlugin({
|
2019-04-05 02:23:40 +07:00
|
|
|
__DEBUG__: true,
|
|
|
|
__APP_VERSION__: `"${getPackageJson('version')}"`,
|
2019-02-03 17:23:33 +07:00
|
|
|
}),
|
|
|
|
new HTMLWebpackPlugin({
|
2019-06-20 19:37:28 +07:00
|
|
|
__UI_OPTIONS: JSON.stringify({
|
|
|
|
base: '/',
|
|
|
|
}),
|
2019-04-05 02:23:40 +07:00
|
|
|
title: 'Verdaccio Dev UI',
|
|
|
|
scope: '',
|
|
|
|
logo: 'https://verdaccio.org/img/logo/symbol/svg/verdaccio-tiny.svg',
|
|
|
|
filename: 'index.html',
|
2019-07-28 16:49:02 +07:00
|
|
|
verdaccioURL: '//localhost:4872',
|
2019-06-20 19:37:28 +07:00
|
|
|
template: `${env.SRC_ROOT}/template/index.html`,
|
2019-02-03 17:23:33 +07:00
|
|
|
debug: true,
|
2019-04-05 02:23:40 +07:00
|
|
|
inject: true,
|
2019-02-03 17:23:33 +07:00
|
|
|
}),
|
|
|
|
new webpack.HotModuleReplacementPlugin(),
|
|
|
|
new webpack.NoEmitOnErrorsPlugin(),
|
|
|
|
new FriendlyErrorsPlugin(),
|
|
|
|
new StyleLintPlugin({
|
2019-06-20 19:37:28 +07:00
|
|
|
files: ['src/**/styles.ts'],
|
2019-02-03 17:23:33 +07:00
|
|
|
failOnError: false,
|
2019-06-20 19:37:28 +07:00
|
|
|
emitErrors: false,
|
2019-04-05 02:23:40 +07:00
|
|
|
}),
|
|
|
|
],
|
2019-02-03 17:23:33 +07:00
|
|
|
};
|