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.config.js
Juan Picado d43894e8f6
feat: rework web header for mobile, add new settings and raw manifest button (#3129)
* feat: rework header, dialogs and new raw mode

* chore: add test for raw button and hide download tarball

* chore: add test hide footer

* chore: add docs to config files

* chore: add changeset

* chore: enable raw by default
2022-04-16 12:26:02 +02:00

86 lines
1.7 KiB
JavaScript

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',
publicPath: '-/static/',
},
resolve: {
extensions: ['.wasm', '.mjs', '.js', '.jsx', '.ts', '.tsx'],
modules: ['node_modules'],
alias: {
'verdaccio-ui/components': `${env.SRC_ROOT}/components`,
'verdaccio-ui/design-tokens': `${env.SRC_ROOT}/design-tokens`,
'verdaccio-ui/utils': `${env.SRC_ROOT}/utils`,
'verdaccio-ui/providers': `${env.SRC_ROOT}/providers`,
},
},
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: /\.jsx?$/,
exclude: /node_modules/,
use: 'babel-loader',
},
{
test: /\.m?js/,
resolve: {
fullySpecified: false,
},
},
{
test: /\.(jpe?g|png|gif|svg)$/,
type: 'asset/inline',
},
{
test: /\.css$/i,
use: ['style-loader', 'css-loader'],
},
{
test: /\.md$/,
use: 'raw-loader',
},
/* Typescript loader */
{
test: /\.tsx?$/,
use: 'babel-loader',
exclude: /node_modules/,
},
],
},
stats: {
children: false,
},
};