Skip to content

Instantly share code, notes, and snippets.

@mrFANRA
Last active November 20, 2020 14:08
Show Gist options
  • Save mrFANRA/8b31281af1a97d578838ba7e5608e094 to your computer and use it in GitHub Desktop.
Save mrFANRA/8b31281af1a97d578838ba7e5608e094 to your computer and use it in GitHub Desktop.
require('dotenv').config();
const MomentLocalesPlugin = require('moment-locales-webpack-plugin');
const isDev = process.env.NODE_ENV !== 'production';
module.exports = {
components: true,
loading: { color: '#3B8070' },
loadingIndicator: {
name: 'circle',
color: '#3B8070',
background: 'white'
},
router: {
prefetchLinks: false
},
pageTransition: {
css: false
},
head:{
htmlAttrs: { lang: 'ru' },
meta:[
{charset: 'utf-8'},
{name: 'viewport', content: 'width=device-width, initial-scale=1'},
],
link: [
{rel: 'icon', type: 'image/x-icon', href: '/favicon.ico'},
],
},
styleResources: {
scss: [
'~assets/css/vars.scss',
],
},
css: [
'~assets/css/app.scss',
'@fortawesome/fontawesome-svg-core/styles.css',
'swiper/swiper-bundle.css'
],
/*
** Customize the progress bar color
*/
plugins: [
{src: '@/plugins/axios.js'},
//{src: '@/plugins/datepicker.js', ssr: false},
{src: '@/plugins/font-awesome.js'},
{src: '@/plugins/global.js'},
{src: '@/plugins/localStorage.js', ssr: false},
{src: '@/plugins/notifier.js'},
{src: '@/plugins/vee-validate.js', ssr: false},
{src: '@/plugins/moment.js'},
{src: '@/plugins/vue-js-modal', ssr: false},
{src: '@/plugins/vuejs-dialog', ssr: false},
{src: '@/plugins/swiper', ssr: false},
{src: '@/plugins/vue-lazy-load'},
],
buildModules: [
'nuxt-webfontloader',
'nuxt-purgecss',
'@nuxtjs/style-resources',
],
modules: [
'@nuxtjs/axios',
'@nuxtjs/router',
'@nuxtjs/toast',
['@nuxtjs/dotenv', { systemvars: true }],
['@nuxtjs/yandex-metrika', {
id: '55051456',
webvisor: true,
clickmap:true,
useCDN:false,
trackLinks:true,
accurateTrackBounce:true,
}],
'bootstrap-vue/nuxt',
],
toast: {
position: 'top-right',
duration: 3500,
},
axios: {
proxy: true,
},
bootstrapVue: {
bootstrapCSS: false,
bootstrapVueCSS: false,
componentPlugins: ['NavbarPlugin','CarouselPlugin','TabsPlugin'],
},
proxy: {
'/api': {
target: process.env.apiUrl,
pathRewrite: {
'^/api' : "/v0/"+process.env.apiID+"-"+process.env.apiKEY
},
},
},
/*
** Build configuration
*/
build: {
extractCSS: true,
optimization: {
splitChunks: {
chunks: 'all'
}
},
splitChunks: {
layouts: false,
pages: true,
commons: true
},
filenames: {
css: ({isDev}) => isDev ? '[name].css' : '[contenthash].css',
},
plugins: [
new MomentLocalesPlugin({
localesToKeep: ['es-us', 'ru'],
}),
]
},
render: {
compressor: false,
resourceHints: false,
etag: false,
crossorigin: "anonymous"
},
purgeCSS: {
mode: 'postcss',
whitelistPatterns: [/brc.*?$/, /vgt.*?$/, /vue.*?$/, /ql.*?$/, /theme.*?$/],
whitelist: ['label', 'field-label']
},
webfontloader: {
google: {
families: ['Roboto:400,500:cyrillic&display=swap']
}
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment