mirror of
https://github.com/SomboChea/ui
synced 2024-11-28 08:54:27 +07:00
3d752e079c
this object will replace the other variables, it is more easy to scale adding new properties. I'll extend the info in a future documents about plugins.
57 lines
1.5 KiB
JavaScript
57 lines
1.5 KiB
JavaScript
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`,
|
|
],
|
|
},
|
|
|
|
output: {
|
|
...baseConfig.output,
|
|
publicPath: '/',
|
|
},
|
|
|
|
devtool: 'cheap-module-eval-source-map',
|
|
|
|
plugins: [
|
|
new webpack.DefinePlugin({
|
|
__DEBUG__: true,
|
|
__APP_VERSION__: `"${getPackageJson('version')}"`,
|
|
}),
|
|
new HTMLWebpackPlugin({
|
|
__UI_OPTIONS: JSON.stringify({base: '/'}),
|
|
title: 'Verdaccio Dev UI',
|
|
scope: '',
|
|
logo: 'https://verdaccio.org/img/logo/symbol/svg/verdaccio-tiny.svg',
|
|
filename: 'index.html',
|
|
verdaccioURL: '//localhost:8080',
|
|
template: `${env.SRC_ROOT}/webui/template/index.html`,
|
|
debug: true,
|
|
inject: true,
|
|
}),
|
|
new webpack.HotModuleReplacementPlugin(),
|
|
new webpack.NoEmitOnErrorsPlugin(),
|
|
new FriendlyErrorsPlugin(),
|
|
new StyleLintPlugin({
|
|
files: ['src/webui/**/styles.js'],
|
|
failOnError: false,
|
|
emitErrors: false
|
|
}),
|
|
],
|
|
};
|