mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
* vue: use our own store in place of vuex * vue store: add getters, watcher and use internal vue instance * vue store: better state getter and credits to Vuex * vue store: $watch -> watch * vuex store: pass store to getters and fix typos * add comments to store, start writing tests * fix unit tests and add missing ones * cleanup components, add less folder, fetch tassks * use Vuex helpers * pin vuex version * move semantic-ui theme to assets/less, keep website/build empty but in git * import helpers from vuex
92 lines
2.1 KiB
JavaScript
92 lines
2.1 KiB
JavaScript
var path = require('path');
|
|
var config = require('./config');
|
|
var utils = require('./utils');
|
|
var projectRoot = path.resolve(__dirname, '../');
|
|
|
|
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: {
|
|
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')],
|
|
},
|
|
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'],
|
|
}),
|
|
],
|
|
},
|
|
};
|
|
|
|
if (!IS_PROD) {
|
|
baseConfig.eslint = {
|
|
formatter: require('eslint-friendly-formatter'),
|
|
emitWarning: true,
|
|
};
|
|
}
|
|
module.exports = baseConfig; |