0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-23 22:27:34 -05:00
verdaccio/packages/plugins/ui-theme/tools/webpack.dev.config.babel.js
Juan Picado a2b69a08e2
add banner support ukraine (#3060)
* add banner support ukraine

* fix test

* add blood link

* Update packages/plugins/ui-theme/src/App/Header/Support/Support.tsx

Co-authored-by: Daniel Ruf <827205+DanielRuf@users.noreply.github.com>

Co-authored-by: Daniel Ruf <827205+DanielRuf@users.noreply.github.com>
2022-03-12 22:42:05 +01:00

58 lines
1.5 KiB
JavaScript

import FriendlyErrorsPlugin from 'friendly-errors-webpack-plugin';
import fs from 'fs';
import HTMLWebpackPlugin from 'html-webpack-plugin';
import yalm from 'js-yaml';
import StyleLintPlugin from 'stylelint-webpack-plugin';
import webpack from 'webpack';
import env from '../config/env';
import getPackageJson from './getPackageJson';
import baseConfig from './webpack.config';
const configJsonFormat = yalm.safeLoad(fs.readFileSync('./tools/_verdaccio.config.yaml', 'utf8'));
export default {
...baseConfig,
mode: 'development',
entry: {
main: [
'whatwg-fetch',
'react-hot-loader/patch',
'webpack-dev-server/client?http://localhost:4873',
'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({
...configJsonFormat.web,
version: '1.0.0',
filename: 'index.html',
base: new URL('/', 'http://localhost:4873'),
}),
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,
}),
],
};