mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 22:05:43 +01:00
70 lines
1.7 KiB
JavaScript
70 lines
1.7 KiB
JavaScript
// shared config (dev and prod)
|
|
const path = require('path');
|
|
const ForkTsCheckerNotifierWebpackPlugin = require('fork-ts-checker-notifier-webpack-plugin');
|
|
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
|
|
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
|
const Dotenv = require('dotenv-webpack');
|
|
|
|
module.exports = {
|
|
resolve: {
|
|
extensions: ['.ts', '.tsx', '.js', '.jsx'],
|
|
alias: {
|
|
src: path.resolve('src/')
|
|
}
|
|
},
|
|
context: process.cwd(),
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.js$/,
|
|
use: ['babel-loader', 'source-map-loader'],
|
|
exclude: /node_modules/,
|
|
},
|
|
{
|
|
test: /\.tsx?$/,
|
|
exclude: /node_modules/,
|
|
use: [
|
|
{
|
|
loader: 'babel-loader',
|
|
},
|
|
{
|
|
loader: 'ts-loader',
|
|
options: { transpileOnly: true }
|
|
}
|
|
]
|
|
},
|
|
{
|
|
test: /\.css$/,
|
|
use: ['style-loader', { loader: 'css-loader', options: { importLoaders: 1 } }],
|
|
},
|
|
{
|
|
test: /\.(scss|sass)$/,
|
|
loaders: [
|
|
'style-loader',
|
|
{ loader: 'css-loader', options: { importLoaders: 1 } },
|
|
'sass-loader',
|
|
'import-glob-loader'
|
|
],
|
|
},
|
|
{
|
|
test: /\.(graphql|gql)$/,
|
|
exclude: /node_modules/,
|
|
loader: 'graphql-tag/loader',
|
|
}
|
|
],
|
|
},
|
|
output: {
|
|
publicPath: '/'
|
|
},
|
|
plugins: [
|
|
new ForkTsCheckerWebpackPlugin({
|
|
eslint: true
|
|
}),
|
|
new ForkTsCheckerNotifierWebpackPlugin({ title: 'TypeScript', excludeWarnings: false }),
|
|
new HtmlWebpackPlugin({template: "./src/index.html.ejs"}),
|
|
new Dotenv()
|
|
],
|
|
performance: {
|
|
hints: false,
|
|
},
|
|
};
|