forked from sombochea/verdaccio-ui
6b322ad553
* Revert "Revert "fix(#300): correctly reference registry url from options" (#311)"
This reverts commit d955268c25
.
* fix: generate full URL from path
61 lines
1.5 KiB
JavaScript
61 lines
1.5 KiB
JavaScript
import webpack from 'webpack';
|
|
import HTMLWebpackPlugin from 'html-webpack-plugin';
|
|
import FriendlyErrorsPlugin from 'friendly-errors-webpack-plugin';
|
|
import StyleLintPlugin from 'stylelint-webpack-plugin';
|
|
|
|
import env from '../config/env';
|
|
|
|
import baseConfig from './webpack.config';
|
|
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}/index.tsx`,
|
|
],
|
|
},
|
|
|
|
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: new URL('/', 'https://localhost:4872'),
|
|
}),
|
|
title: 'Verdaccio Dev UI',
|
|
scope: '',
|
|
logo: 'https://verdaccio.org/img/logo/symbol/svg/verdaccio-tiny.svg',
|
|
filename: 'index.html',
|
|
verdaccioURL: '//localhost:4872',
|
|
template: `${env.SRC_ROOT}/template/index.html`,
|
|
debug: true,
|
|
inject: true,
|
|
}),
|
|
new webpack.HotModuleReplacementPlugin(),
|
|
new webpack.NoEmitOnErrorsPlugin(),
|
|
new FriendlyErrorsPlugin(),
|
|
new StyleLintPlugin({
|
|
files: ['src/**/styles.ts'],
|
|
failOnError: false,
|
|
emitErrors: false,
|
|
}),
|
|
],
|
|
};
|