mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-13 20:57:24 +01:00
* Client: fix Apidoc and move email files (#9139) * fix apidoc * move emails files * quest leader can start/end quest; admins can edit challenges/guilds; reverse chat works; remove static/videos link; etc (#9140) * enable link to markdown info on group and challenge edit screen * allow admin (moderators and staff) to edit challenges * allow admin (moderators and staff) to edit guilds Also add some unrelated TODO comments. * allow any party member (not just leader) to start quest from party page * allow quest owner to cancel, begin, abort quest Previously only the party leader could see those buttons. The leader still can. This also hides those buttons from all other party members. * enable reverse chat in guilds and party * remove outdated videos from press kit * adjust various wordings * Be consistent with capitalization of Check-In. (#9118) * limit for inlined svg images and make home leaner by not bundling it with the rest of static pages * sep 27 fixes (#9088) * fix item paddings / drawer width * expand the width of item-rows by the margin of an item * fix hatchedPet-dialog * fix hatching-modal * remove min-height * Oct 3 fixes (#9148) * Only show level after yesterdailies modal * Fixed zindex * Added spcial spells to rewards column * Added single click buy for health and armoire * Prevented task scoring when casting a spell * Renamed generic purchase method * Updated nav for small screen * Hide checklist while casting * fix some text describing menu items (#9145)
137 lines
3.8 KiB
JavaScript
137 lines
3.8 KiB
JavaScript
/* eslint-disable no-process-env, no-console */
|
|
|
|
const path = require('path');
|
|
const config = require('./config');
|
|
const utils = require('./utils');
|
|
const webpack = require('webpack');
|
|
const projectRoot = path.resolve(__dirname, '../');
|
|
const autoprefixer = require('autoprefixer');
|
|
const postcssEasyImport = require('postcss-easy-import');
|
|
const IS_PROD = process.env.NODE_ENV === 'production';
|
|
|
|
const baseConfig = {
|
|
entry: {
|
|
app: './website/client/main.js',
|
|
},
|
|
output: {
|
|
path: config.build.assetsRoot,
|
|
publicPath: IS_PROD ? config.build.assetsPublicPath : config.dev.assetsPublicPath,
|
|
filename: '[name].js',
|
|
devtoolModuleFilenameTemplate (info) {
|
|
// Fix source maps, code from
|
|
// https://github.com/Darkside73/bbsmile.com.ua/commit/3596d3c42ef91b69d8380359c3e8908edc08acdb
|
|
let filename = info.resourcePath;
|
|
if (info.resource.match(/\.vue$/) && !info.allLoaders.match(/type=script/)) {
|
|
filename = 'generated';
|
|
}
|
|
|
|
return filename;
|
|
},
|
|
},
|
|
resolve: {
|
|
extensions: ['*', '.js', '.vue', '.json'],
|
|
modules: [
|
|
path.join(projectRoot, 'website'),
|
|
path.join(projectRoot, 'test/client/unit'),
|
|
path.join(projectRoot, 'node_modules'),
|
|
],
|
|
alias: {
|
|
website: path.resolve(projectRoot, 'website'),
|
|
common: path.resolve(projectRoot, 'website/common'),
|
|
client: path.resolve(projectRoot, 'website/client'),
|
|
assets: path.resolve(projectRoot, 'website/client/assets'),
|
|
components: path.resolve(projectRoot, 'website/client/components'),
|
|
},
|
|
},
|
|
plugins: [
|
|
new webpack.ContextReplacementPlugin(/moment[\\\/]locale$/, /^\.\/(NOT_EXISTING)$/),
|
|
],
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.vue$/,
|
|
loader: 'vue-loader',
|
|
options: {
|
|
loaders: utils.cssLoaders({
|
|
sourceMap: IS_PROD ?
|
|
config.build.productionSourceMap :
|
|
config.dev.cssSourceMap,
|
|
extract: IS_PROD,
|
|
}),
|
|
postcss: [
|
|
autoprefixer({
|
|
browsers: ['last 2 versions'],
|
|
}),
|
|
postcssEasyImport(),
|
|
],
|
|
},
|
|
},
|
|
{
|
|
test: /\.js$/,
|
|
loader: 'babel-loader',
|
|
include: [
|
|
path.join(projectRoot, 'test'),
|
|
path.join(projectRoot, 'website'),
|
|
path.join(projectRoot, 'node_modules', 'bootstrap-vue'),
|
|
],
|
|
options: {
|
|
cacheDirectory: true,
|
|
},
|
|
},
|
|
{
|
|
test: /\.(png|jpe?g|gif)(\?.*)?$/,
|
|
loader: 'url-loader',
|
|
query: {
|
|
limit: 10000,
|
|
name: utils.assetsPath('img/[name].[hash:7].[ext]'),
|
|
},
|
|
},
|
|
{
|
|
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
|
|
loader: 'url-loader',
|
|
query: {
|
|
limit: 10000,
|
|
name: utils.assetsPath('fonts/[name].[hash:7].[ext]'),
|
|
},
|
|
},
|
|
{
|
|
test: /\.svg$/,
|
|
use: [
|
|
{ loader: 'svg-inline-loader' },
|
|
{ loader: 'svgo-loader' },
|
|
],
|
|
exclude: [path.resolve(projectRoot, 'website/client/assets/svg/for-css')],
|
|
},
|
|
{
|
|
test: /\.svg$/,
|
|
use: [
|
|
{
|
|
loader: 'svg-url-loader',
|
|
options: {
|
|
limit: 10000,
|
|
},
|
|
},
|
|
{ loader: 'svgo-loader' },
|
|
],
|
|
include: [path.resolve(projectRoot, 'website/client/assets/svg/for-css')],
|
|
},
|
|
],
|
|
},
|
|
};
|
|
|
|
if (!IS_PROD) {
|
|
const eslintFriendlyFormatter = require('eslint-friendly-formatter'); // eslint-disable-line global-require
|
|
|
|
baseConfig.module.rules.unshift({
|
|
test: /\.(js|vue)$/,
|
|
loader: 'eslint-loader',
|
|
enforce: 'pre',
|
|
include: projectRoot,
|
|
options: {
|
|
formatter: eslintFriendlyFormatter,
|
|
emitWarning: true,
|
|
},
|
|
exclude: /node_modules/,
|
|
});
|
|
}
|
|
module.exports = baseConfig; |