mirror of
https://github.com/Findus23/HNReader.git
synced 2024-09-20 16:33:45 +02:00
58 lines
1.3 KiB
JavaScript
58 lines
1.3 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: {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: {
|
||
|
/* ... */
|
||
|
},
|
||
|
};
|