Derick Montague | fded0d1 | 2019-12-11 06:16:40 -0600 | [diff] [blame] | 1 | const CompressionPlugin = require('compression-webpack-plugin'); |
Derick Montague | f3ab8bc | 2019-12-10 15:13:25 -0600 | [diff] [blame] | 2 | |
Yoshie Muranaka | 74c24f1 | 2019-12-03 10:45:46 -0800 | [diff] [blame] | 3 | module.exports = { |
Yoshie Muranaka | dc04feb | 2019-12-04 08:41:22 -0800 | [diff] [blame] | 4 | css: { |
| 5 | loaderOptions: { |
| 6 | scss: { |
| 7 | prependData: ` |
| 8 | @import "@/assets/styles/_obmc-custom.scss"; |
| 9 | ` |
| 10 | } |
| 11 | } |
| 12 | }, |
Yoshie Muranaka | 74c24f1 | 2019-12-03 10:45:46 -0800 | [diff] [blame] | 13 | devServer: { |
Yoshie Muranaka | dc04feb | 2019-12-04 08:41:22 -0800 | [diff] [blame] | 14 | https: true, |
Yoshie Muranaka | 6ce1a07 | 2019-12-06 14:13:59 -0800 | [diff] [blame] | 15 | proxy: { |
Derick Montague | fded0d1 | 2019-12-11 06:16:40 -0600 | [diff] [blame] | 16 | '/': { |
Yoshie Muranaka | 6ce1a07 | 2019-12-06 14:13:59 -0800 | [diff] [blame] | 17 | target: process.env.BASE_URL, |
| 18 | onProxyRes: proxyRes => { |
Yoshie Muranaka | dc04feb | 2019-12-04 08:41:22 -0800 | [diff] [blame] | 19 | // This header is igorned in the browser so removing |
| 20 | // it so we don't see warnings in the browser console |
| 21 | delete proxyRes.headers['strict-transport-security']; |
Yoshie Muranaka | 6ce1a07 | 2019-12-06 14:13:59 -0800 | [diff] [blame] | 22 | } |
| 23 | } |
Derick Montague | f3ab8bc | 2019-12-10 15:13:25 -0600 | [diff] [blame] | 24 | }, |
| 25 | port: 8000 |
| 26 | }, |
| 27 | productionSourceMap: false, |
| 28 | configureWebpack: config => { |
Derick Montague | fded0d1 | 2019-12-11 06:16:40 -0600 | [diff] [blame] | 29 | if (process.env.NODE_ENV === 'production') { |
Derick Montague | f3ab8bc | 2019-12-10 15:13:25 -0600 | [diff] [blame] | 30 | config.plugins.push( |
| 31 | new CompressionPlugin({ |
| 32 | deleteOriginalAssets: true |
| 33 | }) |
| 34 | ); |
| 35 | } |
| 36 | }, |
| 37 | chainWebpack: config => { |
Derick Montague | fded0d1 | 2019-12-11 06:16:40 -0600 | [diff] [blame] | 38 | if (process.env.NODE_ENV === 'production') { |
| 39 | config.plugins.delete('prefetch'); |
| 40 | config.plugins.delete('preload'); |
Yoshie Muranaka | 6ce1a07 | 2019-12-06 14:13:59 -0800 | [diff] [blame] | 41 | } |
Yoshie Muranaka | 74c24f1 | 2019-12-03 10:45:46 -0800 | [diff] [blame] | 42 | } |
| 43 | }; |