1
0
Fork 0
mirror of https://github.com/Findus23/HNReader.git synced 2024-09-20 16:33:45 +02:00
HNReader/web/snowpack.config.js

58 lines
1.3 KiB
JavaScript
Raw Normal View History

2021-04-08 22:29:27 +02:00
const httpProxy = require('http-proxy');
const proxy = httpProxy.createProxyServer({
2021-04-09 16:17:53 +02:00
target: 'http://localhost:8000',
2021-04-08 22:29:27 +02:00
timeout: 30 * 1000
});
/** @type {import("snowpack").SnowpackUserConfig } */
module.exports = {
mount: {
public: {url: '/', static: true},
src: {url: '/dist'},
},
plugins: [
'@snowpack/plugin-sass',
'@snowpack/plugin-vue',
[
'snowpack-plugin-replace',
{
list: [
{
from: '__VUE_OPTIONS_API__',
to: 'false'
},
{
from: '__VUE_PROD_DEVTOOLS__',
to: 'true'
}
],
}
],
],
routes: [
/* Enable an SPA Fallback in development: */
{
src: '/api/.*',
dest: (req, res) => {
proxy.web(req, res, e => console.log(e));
},
},
{"match": "routes", "src": ".*", "dest": "/index.html"},
],
optimize: {
/* Example: Bundle your final build: */
bundle: true,
minify: true,
target: "es2018"
},
packageOptions: {
/* ... */
},
devOptions: {
/* ... */
},
buildOptions: {
/* ... */
},
};