1
0
mirror of https://github.com/SomboChea/ui synced 2024-11-17 03:34:27 +07:00
verdaccio-ui/tools/webpack.config.js
Daniel Ruf bae9638b23 fix: add missing trailing slash to publicPath - closes #395 (#396)
* fix: add missing trailing slash to publicPath - closes #395

* test: update snapshot

(cherry picked from commit fe6494fec7225928cc510e112c80e4b171160a09)

Co-authored-by: Juan Picado @jotadeveloper <juanpicado19@gmail.com>
2019-12-30 10:12:23 +01:00

100 lines
1.8 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].[hash].js',
publicPath: '/-/static/',
},
resolve: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
plugins: [
new StyleLintPlugin({
files: ['src/**/styles.ts'],
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: /\.(woff|woff2|eot|ttf|otf)$/,
loader: 'url-loader',
options: {
name: '[name].[ext]',
outputPath: 'fonts',
limit: 50,
},
},
{
test: /\.css$/,
use: [
{
loader: 'style-loader',
},
{
loader: 'css-loader',
},
],
},
/* Typescript loader */
{
test: /\.tsx?$/,
use: 'babel-loader',
exclude: /node_modules/,
},
],
},
stats: {
children: false,
},
};