1
0
mirror of https://github.com/SomboChea/ui synced 2024-11-16 19:24:28 +07:00
verdaccio-ui/tools/webpack.dev.config.babel.js

56 lines
1.4 KiB
JavaScript
Raw Normal View History

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';
import env from '../src/config/env';
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',
`${env.SRC_ROOT}/webui/index.js`,
],
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-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',
verdaccioURL: '//localhost:4873',
template: `${env.SRC_ROOT}/webui/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-04-05 02:23:40 +07:00
files: ['src/webui/**/styles.js'],
2019-02-03 17:23:33 +07:00
failOnError: false,
emitErrors: false
2019-04-05 02:23:40 +07:00
}),
],
2019-02-03 17:23:33 +07:00
};