1
0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-11-13 03:35:52 +01:00
verdaccio/tools/webpack.config.js
Juan Picado @jotadeveloper cbf42ee063
chore: reduce severity on stylelint
temporary solution
2018-12-15 09:40:43 +01:00

111 lines
2.1 KiB
JavaScript

const env = require('../src/config/env');
const StyleLintPlugin = require('stylelint-webpack-plugin');
module.exports = {
entry: `${env.SRC_ROOT}/webui/src/index.js`,
output: {
path: `${env.APP_ROOT}/static/`,
filename: '[name].[hash].js',
publicPath: 'ToReplaceByVerdaccio/-/static',
},
resolve: {
extensions: ['.js', '.jsx'],
},
plugins: [
new StyleLintPlugin({
files: ['src/webui/**/styles.js'],
failOnError: false,
emitErrors: true
}),
],
optimization: {
runtimeChunk: {
name: 'manifest',
},
splitChunks: {
cacheGroups: {
vendor: {
test: /[\\/]node_modules[\\/]/,
name: 'vendors',
priority: -20,
chunks: 'all',
},
},
},
},
module: {
rules: [
/* Pre loader */
{
enforce: 'pre',
test: /\.jsx?$/,
exclude: /node_modules/,
use: 'eslint-loader',
},
/* Normal loader */
{
test: /\.jsx?$/,
exclude: /node_modules/,
use: 'babel-loader',
},
{
test: /\.(jpe?g|png|gif|svg)$/,
use: [
{
loader: 'file-loader'
},
]
},
{
test: /\.(ttf|eot|woff|woff2)$/,
loader: 'url-loader',
options: {
limit: 50000,
name: 'fonts/[hash].[ext]',
},
},
{
test: /\.scss$/,
exclude: /node_modules/,
use: [
{
loader: 'style-loader',
},
{
loader: 'css-loader',
options: {
sourceMap: true,
module: true,
localIdentName: '[path][name]__[local]--[hash:base64:5]',
},
},
{
loader: 'sass-loader',
},
],
},
{
test: /\.css$/,
use: [
{
loader: 'style-loader',
},
{
loader: 'css-loader',
},
],
},
],
},
stats: {
children: false,
},
};