0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-16 21:56:25 -05:00
verdaccio/tools/webpack.dev.config.babel.js

56 lines
1.4 KiB
JavaScript
Raw Normal View History

import webpack from 'webpack';
import HTMLWebpackPlugin from 'html-webpack-plugin';
import FriendlyErrorsPlugin from 'friendly-errors-webpack-plugin';
import baseConfig from './webpack.config';
import env from '../src/config/env';
import StyleLintPlugin from 'stylelint-webpack-plugin';
import getPackageJson from './getPackageJson';
export default {
...baseConfig,
mode: 'development',
entry: {
main: [
'whatwg-fetch',
'react-hot-loader/patch',
'webpack-dev-server/client?http://localhost:4872',
'webpack/hot/only-dev-server',
`${env.SRC_ROOT}/webui/index.js`,
2017-07-15 15:04:58 -05:00
],
},
output: {
...baseConfig.output,
2017-07-15 15:04:58 -05:00
publicPath: '/',
},
devtool: 'cheap-module-eval-source-map',
plugins: [
new webpack.DefinePlugin({
2018-02-19 13:29:14 -05:00
__DEBUG__: true,
__APP_VERSION__: `"${getPackageJson('version')}"`,
}),
new HTMLWebpackPlugin({
title: 'Verdaccio Dev UI',
scope: '',
logo: 'https://verdaccio.org/img/logo/symbol/svg/verdaccio-tiny.svg',
filename: 'index.html',
verdaccioURL: '//localhost:4873',
template: `${env.SRC_ROOT}/webui/template/index.html`,
debug: true,
inject: true,
}),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
2017-07-15 15:04:58 -05:00
new FriendlyErrorsPlugin(),
new StyleLintPlugin({
files: ['src/webui/**/styles.js'],
failOnError: false,
emitErrors: false
}),
2017-07-15 15:04:58 -05:00
],
};