blob: 12a723d6b7613b4906f6771196b8c554364da4db [file] [log] [blame]
Derick Montaguefded0d12019-12-11 06:16:40 -06001const CompressionPlugin = require('compression-webpack-plugin');
Derick Montaguef3ab8bc2019-12-10 15:13:25 -06002
Yoshie Muranaka74c24f12019-12-03 10:45:46 -08003module.exports = {
Yoshie Muranakadc04feb2019-12-04 08:41:22 -08004 css: {
5 loaderOptions: {
6 scss: {
7 prependData: `
8 @import "@/assets/styles/_obmc-custom.scss";
9 `
10 }
11 }
12 },
Yoshie Muranaka74c24f12019-12-03 10:45:46 -080013 devServer: {
Yoshie Muranakadc04feb2019-12-04 08:41:22 -080014 https: true,
Yoshie Muranaka6ce1a072019-12-06 14:13:59 -080015 proxy: {
Derick Montaguefded0d12019-12-11 06:16:40 -060016 '/': {
Yoshie Muranaka6ce1a072019-12-06 14:13:59 -080017 target: process.env.BASE_URL,
18 onProxyRes: proxyRes => {
Dixsie Wolmerscbcd2132020-01-30 20:58:37 -060019 // This header is ignored in the browser so removing
Yoshie Muranakadc04feb2019-12-04 08:41:22 -080020 // it so we don't see warnings in the browser console
21 delete proxyRes.headers['strict-transport-security'];
Yoshie Muranaka6ce1a072019-12-06 14:13:59 -080022 }
23 }
Derick Montaguef3ab8bc2019-12-10 15:13:25 -060024 },
25 port: 8000
26 },
27 productionSourceMap: false,
28 configureWebpack: config => {
Derick Montaguefded0d12019-12-11 06:16:40 -060029 if (process.env.NODE_ENV === 'production') {
Derick Montaguef3ab8bc2019-12-10 15:13:25 -060030 config.plugins.push(
31 new CompressionPlugin({
32 deleteOriginalAssets: true
33 })
34 );
35 }
36 },
37 chainWebpack: config => {
Derick Montaguefded0d12019-12-11 06:16:40 -060038 if (process.env.NODE_ENV === 'production') {
39 config.plugins.delete('prefetch');
40 config.plugins.delete('preload');
Yoshie Muranaka6ce1a072019-12-06 14:13:59 -080041 }
Dixsie Wolmerscbcd2132020-01-30 20:58:37 -060042 },
43 pluginOptions: {
44 i18n: {
45 localeDir: 'locales',
46 enableInSFC: true
47 }
Yoshie Muranaka74c24f12019-12-03 10:45:46 -080048 }
49};