2017-06-25 20:13:39 +02:00
|
|
|
import webpack from 'webpack';
|
|
|
|
import HTMLWebpackPlugin from 'html-webpack-plugin';
|
|
|
|
import FriendlyErrorsPlugin from 'friendly-errors-webpack-plugin';
|
2017-07-13 23:28:45 +02:00
|
|
|
import baseConfig from './webpack.config';
|
2017-07-15 21:58:05 +02:00
|
|
|
import env from '../src/config/env';
|
2017-07-22 17:34:29 +02:00
|
|
|
import StyleLintPlugin from 'stylelint-webpack-plugin';
|
2018-01-28 18:28:03 +01:00
|
|
|
import getPackageVersion from './getPackageVersion';
|
2017-06-25 20:13:39 +02:00
|
|
|
|
|
|
|
export default {
|
|
|
|
...baseConfig,
|
|
|
|
entry: {
|
|
|
|
main: [
|
2018-03-20 07:21:54 +01:00
|
|
|
'whatwg-fetch',
|
2017-06-25 20:13:39 +02:00
|
|
|
'react-hot-loader/patch',
|
|
|
|
'webpack-dev-server/client?http://localhost:4872',
|
|
|
|
'webpack/hot/only-dev-server',
|
2017-07-15 22:04:58 +02:00
|
|
|
`${env.SRC_ROOT}/webui/src/index.js`,
|
|
|
|
],
|
2017-06-25 20:13:39 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
output: {
|
|
|
|
...baseConfig.output,
|
2017-07-15 22:04:58 +02:00
|
|
|
publicPath: '/',
|
2017-06-25 20:13:39 +02:00
|
|
|
},
|
|
|
|
|
2018-03-20 07:21:54 +01:00
|
|
|
devtool: 'cheap-module-eval-source-map',
|
|
|
|
|
2017-06-25 20:13:39 +02:00
|
|
|
plugins: [
|
|
|
|
new webpack.DefinePlugin({
|
2018-02-19 19:29:14 +01:00
|
|
|
__DEBUG__: true,
|
2017-07-15 22:04:58 +02:00
|
|
|
'process.env.NODE_ENV': '"development"',
|
2018-02-19 19:29:14 +01:00
|
|
|
__APP_VERSION__: `"${getPackageVersion()}"`,
|
2017-06-25 20:13:39 +02:00
|
|
|
}),
|
|
|
|
new HTMLWebpackPlugin({
|
|
|
|
title: 'Verdaccio',
|
|
|
|
filename: 'index.html',
|
2017-07-09 17:44:11 +02:00
|
|
|
verdaccioURL: '//localhost:4873',
|
2017-07-13 19:55:19 +02:00
|
|
|
template: `${env.SRC_ROOT}/webui/template/index.html`,
|
2017-06-25 20:13:39 +02:00
|
|
|
debug: true,
|
|
|
|
inject: true,
|
|
|
|
}),
|
|
|
|
new webpack.HotModuleReplacementPlugin(),
|
|
|
|
new webpack.NoEmitOnErrorsPlugin(),
|
2017-07-15 22:04:58 +02:00
|
|
|
new FriendlyErrorsPlugin(),
|
2017-07-22 17:34:29 +02:00
|
|
|
new StyleLintPlugin({
|
|
|
|
files: ['src/**/*.scss'],
|
|
|
|
failOnError: false,
|
|
|
|
emitErrors: false,
|
|
|
|
syntax: 'scss',
|
|
|
|
}),
|
2017-07-15 22:04:58 +02:00
|
|
|
],
|
2017-07-13 23:28:45 +02:00
|
|
|
};
|