mirror of
https://github.com/psforever/PSFPortal.git
synced 2026-01-19 18:14:45 +00:00
* Change favicon * Display account banned status on admin search * Pull in application version from Webpack * Add "Feedback" button in footer and github references * Fix faction icons to make them the same size * PaginatedList component now supports back * Tabbed navs support back * Hide Pagination when only one page * Improve admin table style and size
85 lines
1.7 KiB
JavaScript
85 lines
1.7 KiB
JavaScript
const webpack = require('webpack');
|
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
const path = require('path');
|
|
|
|
const mode = process.env.NODE_ENV || 'development';
|
|
const prod = mode === 'production';
|
|
|
|
module.exports = {
|
|
entry: {
|
|
bundle: ['./app/main.js']
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
svelte: path.resolve('node_modules', 'svelte')
|
|
},
|
|
extensions: ['.mjs', '.js', '.svelte'],
|
|
mainFields: ['svelte', 'browser', 'module', 'main']
|
|
},
|
|
output: {
|
|
path: __dirname + '/public',
|
|
filename: '[name].js',
|
|
chunkFilename: '[name].[id].js'
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.svelte$/,
|
|
use: {
|
|
loader: 'svelte-loader',
|
|
options: {
|
|
emitCss: true,
|
|
hotReload: true
|
|
}
|
|
}
|
|
},
|
|
{
|
|
test: /\.css$/,
|
|
use: [
|
|
/**
|
|
* MiniCssExtractPlugin doesn't support HMR.
|
|
* For developing, use 'style-loader' instead.
|
|
* */
|
|
prod ? MiniCssExtractPlugin.loader : 'style-loader',
|
|
'css-loader'
|
|
]
|
|
},
|
|
{
|
|
test: /\.(scss)$/,
|
|
use: [{
|
|
loader: 'style-loader', // inject CSS to page
|
|
}, {
|
|
loader: 'css-loader', // translates CSS into CommonJS modules
|
|
}, {
|
|
loader: 'postcss-loader', // Run post css actions
|
|
options: {
|
|
plugins: function () { // post css plugins, can be exported to postcss.config.js
|
|
return [
|
|
require('precss'),
|
|
require('autoprefixer')
|
|
];
|
|
}
|
|
}
|
|
}, {
|
|
loader: 'sass-loader' // compiles Sass to CSS
|
|
}]
|
|
},
|
|
]
|
|
},
|
|
mode,
|
|
plugins: [
|
|
new MiniCssExtractPlugin({
|
|
filename: '[name].css'
|
|
}),
|
|
new webpack.DefinePlugin({
|
|
__VERSION__: JSON.stringify(require("./package.json").version)
|
|
})
|
|
],
|
|
devServer: {
|
|
proxy: {
|
|
'/api': 'http://localhost:8080'
|
|
}
|
|
},
|
|
devtool: prod ? false: 'source-map'
|
|
};
|