yunohost-admin/app/vue.config.js

78 lines
1.5 KiB
JavaScript
Raw Normal View History

const webpack = require('webpack')
const dateFnsLocales = [
'ar',
'bn', // for 'bn_BD'
'ca', // for 'ca' & 'oc'
'cs',
'de',
'el',
'en-GB', // for 'en' & 'ne'
'eo',
'es',
'eu',
'fr', // for 'fr' & 'br'
'hi',
'hu',
'it',
'nb', // for 'nb_NO'
'nl',
'oc',
'pl',
'pt',
'ru',
'sv',
'tr',
'zh_CN' // for 'zh_Hans'
]
2020-07-06 20:13:01 +02:00
module.exports = {
configureWebpack: {
plugins: [
// Will limit the available locales so webpack won't generate chunks for every
// locales found in `date-fns/locales/` but only those listed.
new webpack.ContextReplacementPlugin(
/date-fns[/\\]/,
new RegExp(`[/\\\\](${dateFnsLocales.join('|')})[/\\\\]index.js$`)
)
]
},
chainWebpack: config => {
config.module
.rule('images')
.use('url-loader')
.loader('url-loader')
.tap(options => Object.assign(options, { limit: 0 }))
},
2020-07-06 20:13:01 +02:00
pluginOptions: {
i18n: {
locale: 'en',
fallbackLocale: 'en',
2020-09-10 19:10:37 +02:00
localeDir: 'src/i18n/locales',
2020-07-06 20:13:01 +02:00
enableInSFC: false
}
2020-07-10 18:36:46 +02:00
},
css: {
loaderOptions: {
sass: {
prependData: '@import "@/scss/_variables.scss";'
}
}
},
2021-01-16 17:46:40 +01:00
publicPath: '/yunohost/admin',
2020-07-10 18:36:46 +02:00
devServer: {
https: true,
2021-01-16 17:46:40 +01:00
disableHostCheck: true,
2020-07-10 18:36:46 +02:00
proxy: {
'^/yunohost': {
target: `https://${process.env.VUE_APP_IP}`,
ws: true,
logLevel: 'debug'
2020-07-10 18:36:46 +02:00
}
},
watchOptions: {
ignored: /node_modules/
2020-07-10 18:36:46 +02:00
}
2020-07-06 20:13:01 +02:00
}
}