mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
* initial work * new client: working navigation and tasks showing up * finish header menu and add avatar component * fix sprites in new client * initial header version * initial styling for top menu * more progress on the header menu * almost complete menu and avatar * correctly apply active class for /social and /help * fix header colors and simplify css * switch from Roboto to native fonts * remove small avatar and add viewport * fixes * fix user menu with and progress bars * fix avatar rendeting * move bars colors to theme * add site overrides * fix tests * shrinkwrap * fix sprites path * another try at fixing the sprites path * another try at fixing the sprites path
103 lines
2.3 KiB
JavaScript
103 lines
2.3 KiB
JavaScript
var path = require('path');
|
|
var config = require('./config');
|
|
var utils = require('./utils');
|
|
var projectRoot = path.resolve(__dirname, '../');
|
|
var webpack = require('webpack');
|
|
|
|
var IS_PROD = process.env.NODE_ENV === 'production';
|
|
var baseConfig = {
|
|
entry: {
|
|
app: './website/client/main.js',
|
|
},
|
|
output: {
|
|
path: config.build.assetsRoot,
|
|
publicPath: IS_PROD ? config.build.assetsPublicPath : config.dev.assetsPublicPath,
|
|
filename: '[name].js',
|
|
},
|
|
resolve: {
|
|
extensions: ['', '.js', '.vue'],
|
|
fallback: [path.join(__dirname, '../node_modules')],
|
|
alias: {
|
|
jquery: 'jquery/src/jquery',
|
|
client: path.resolve(__dirname, '../website/client'),
|
|
assets: path.resolve(__dirname, '../website/client/assets'),
|
|
components: path.resolve(__dirname, '../website/client/components'),
|
|
},
|
|
},
|
|
resolveLoader: {
|
|
fallback: [path.join(__dirname, '../node_modules')],
|
|
},
|
|
plugins: [
|
|
new webpack.ProvidePlugin({
|
|
$: 'jquery',
|
|
jQuery: 'jquery',
|
|
}),
|
|
],
|
|
module: {
|
|
preLoaders: !IS_PROD ? [
|
|
{
|
|
test: /\.vue$/,
|
|
loader: 'eslint',
|
|
include: projectRoot,
|
|
exclude: /node_modules/,
|
|
},
|
|
{
|
|
test: /\.js$/,
|
|
loader: 'eslint',
|
|
include: projectRoot,
|
|
exclude: /node_modules/,
|
|
},
|
|
] : [],
|
|
loaders: [
|
|
{
|
|
test: /\.vue$/,
|
|
loader: 'vue',
|
|
},
|
|
{
|
|
test: /\.js$/,
|
|
loader: 'babel',
|
|
include: projectRoot,
|
|
exclude: /node_modules/,
|
|
},
|
|
{
|
|
test: /\.json$/,
|
|
loader: 'json',
|
|
},
|
|
{
|
|
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
|
|
loader: 'url',
|
|
query: {
|
|
limit: 10000,
|
|
name: utils.assetsPath('img/[name].[hash:7].[ext]'),
|
|
},
|
|
},
|
|
{
|
|
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
|
|
loader: 'url',
|
|
query: {
|
|
limit: 10000,
|
|
name: utils.assetsPath('fonts/[name].[hash:7].[ext]'),
|
|
},
|
|
},
|
|
],
|
|
},
|
|
vue: {
|
|
loaders: utils.cssLoaders(),
|
|
postcss: [
|
|
require('autoprefixer')({
|
|
browsers: ['last 2 versions'],
|
|
}),
|
|
require('postcss-easy-import')({
|
|
glob: true,
|
|
}),
|
|
],
|
|
},
|
|
};
|
|
|
|
if (!IS_PROD) {
|
|
baseConfig.eslint = {
|
|
formatter: require('eslint-friendly-formatter'),
|
|
emitWarning: true,
|
|
};
|
|
}
|
|
module.exports = baseConfig; |