1
0
Fork 0
mirror of https://github.com/Findus23/RadioStats.git synced 2024-09-19 16:03:48 +02:00
RadioStats/web/snowpack.config.js
2021-05-12 20:51:38 +02:00

49 lines
1.2 KiB
JavaScript

const httpProxy = require('http-proxy');
const proxy = httpProxy.createProxyServer({
target: 'http://localhost:5000',
timeout: 30 * 1000
});
/** @type {import("snowpack").SnowpackUserConfig } */
module.exports = {
mount: {
public: {url: '/', static: true},
"src/icons": {url: "/icons/", static: true},
src: {url: '/dist'},
},
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"},
],
plugins: [
"./workaroundPlugin",
"@morgul/snowpack-plugin-vue2",
'@snowpack/plugin-sass',
[
'snowpack-plugin-replace',
{
list: [
{
from: 'process.env.NODE_ENV',
to: JSON.stringify('production')
},
],
}
],
],
optimize: {
/* Example: Bundle your final build: */
bundle: true,
minify: true,
target: "es2018"
},
devOptions: {
open: "none"
}
}