2020-12-22 04:25:07 -05:00
|
|
|
const StyleLintPlugin = require('stylelint-webpack-plugin');
|
|
|
|
|
|
|
|
const env = require('../config/env');
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
entry: `${env.SRC_ROOT}/index.tsx`,
|
|
|
|
|
|
|
|
output: {
|
|
|
|
path: `${env.APP_ROOT}/static/`,
|
|
|
|
filename: '[name].[fullhash].js',
|
2021-03-06 12:56:45 -05:00
|
|
|
publicPath: '-/static/',
|
2020-12-22 04:25:07 -05:00
|
|
|
},
|
|
|
|
|
|
|
|
resolve: {
|
|
|
|
extensions: ['.wasm', '.mjs', '.js', '.jsx', '.ts', '.tsx'],
|
|
|
|
modules: ['node_modules'],
|
|
|
|
alias: {
|
|
|
|
'verdaccio-ui/components': `${env.SRC_ROOT}/components`,
|
|
|
|
'verdaccio-ui/utils': `${env.SRC_ROOT}/utils`,
|
2021-04-15 14:10:28 -05:00
|
|
|
'verdaccio-ui/providers': `${env.SRC_ROOT}/providers`,
|
2020-12-22 04:25:07 -05:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
plugins: [
|
|
|
|
new StyleLintPlugin({
|
|
|
|
files: ['src/**/styles.ts'],
|
|
|
|
failOnError: false,
|
|
|
|
emitErrors: true,
|
|
|
|
}),
|
|
|
|
],
|
|
|
|
|
|
|
|
optimization: {
|
|
|
|
runtimeChunk: {
|
|
|
|
name: 'runtime',
|
|
|
|
},
|
|
|
|
splitChunks: {
|
|
|
|
chunks: 'all',
|
|
|
|
cacheGroups: {
|
|
|
|
commons: {
|
|
|
|
test: /[\\/]node_modules[\\/]/,
|
|
|
|
name: 'vendors',
|
|
|
|
chunks: 'initial',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.m?js/,
|
|
|
|
resolve: {
|
|
|
|
fullySpecified: false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.(jpe?g|png|gif|svg)$/,
|
2021-03-06 12:56:45 -05:00
|
|
|
type: 'asset/inline',
|
2020-12-22 04:25:07 -05:00
|
|
|
},
|
|
|
|
{
|
2021-04-15 14:10:28 -05:00
|
|
|
test: /\.css$/i,
|
2024-02-11 12:05:48 -05:00
|
|
|
use: ['style-loader', 'css-loader'],
|
2020-12-22 04:25:07 -05:00
|
|
|
},
|
2022-04-16 05:26:02 -05:00
|
|
|
{
|
|
|
|
test: /\.md$/,
|
|
|
|
use: 'raw-loader',
|
|
|
|
},
|
2020-12-22 04:25:07 -05:00
|
|
|
{
|
|
|
|
test: /\.tsx?$/,
|
|
|
|
use: 'babel-loader',
|
|
|
|
exclude: /node_modules/,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
|
|
|
|
stats: {
|
|
|
|
children: false,
|
|
|
|
},
|
|
|
|
};
|