1
0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-11-17 07:45:52 +01:00
verdaccio/packages/plugins/ui-theme/tools/webpack.dev.config.babel.js
Juan Picado e9e4552658 feat: ui theme on 5.x (#2033)
* refactor: relocate theme-ui as plugin

* refactor: relocate theme-ui as plugin

* refactor: relocate theme-ui as plugin

* chore: fix lint

* chore: add missing folder

* refactor: relocate theme-ui as plugin

* refactor: relocate theme-ui as plugin

* refactor: relocate theme-ui as plugin

* chore: update scripts

* refactor: relocate theme-ui as plugin

* refactor: relocate theme-ui as plugin

* refactor: relocate theme-ui as plugin

* refactor: relocate theme-ui as plugin
2021-04-09 17:54:29 +02:00

58 lines
1.4 KiB
JavaScript

import FriendlyErrorsPlugin from 'friendly-errors-webpack-plugin';
import HTMLWebpackPlugin from 'html-webpack-plugin';
import StyleLintPlugin from 'stylelint-webpack-plugin';
import webpack from 'webpack';
import env from '../config/env';
import getPackageJson from './getPackageJson';
import baseConfig from './webpack.config';
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: 'inline-cheap-module-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: '',
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,
}),
],
};