1
0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-11-13 03:35:52 +01:00
verdaccio/tools/webpack.dev.config.babel.js
Satyam Yadav dac28d31dd fix: adds webpack banner plugin to tag bundles with version (#784)
refactor: updates let to const in generateBanner module

refactor: adds getPackageJson module to get vlues from package.json

refactor: adds jsdoc comments in getPackageJson module
2018-06-29 11:10:09 +05:30

55 lines
1.3 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/src/index.js`,
],
},
output: {
...baseConfig.output,
publicPath: '/',
},
devtool: 'cheap-module-eval-source-map',
plugins: [
new webpack.DefinePlugin({
__DEBUG__: true,
__APP_VERSION__: `"${getPackageJson('version')}"`,
}),
new HTMLWebpackPlugin({
title: 'Verdaccio',
filename: 'index.html',
verdaccioURL: '//localhost:4873',
template: `${env.SRC_ROOT}/webui/template/index.html`,
debug: true,
inject: true,
}),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
new FriendlyErrorsPlugin(),
new StyleLintPlugin({
files: ['src/**/*.scss'],
failOnError: false,
emitErrors: false,
syntax: 'scss',
}),
],
};