|
|
|
@ -14,32 +14,6 @@ import replace from "rollup-plugin-replace" |
|
|
|
|
|
|
|
import path from "path" |
|
|
|
|
|
|
|
const target = "http://localhost:4001" |
|
|
|
const _builderProxy = proxy("/_builder", { |
|
|
|
target: "http://localhost:3000", |
|
|
|
pathRewrite: { "^/_builder": "" }, |
|
|
|
}) |
|
|
|
|
|
|
|
const apiProxy = proxy( |
|
|
|
[ |
|
|
|
"/_builder/assets/**", |
|
|
|
"/_builder/api/**", |
|
|
|
"/_builder/**/componentlibrary", |
|
|
|
"/_builder/instance/**", |
|
|
|
], |
|
|
|
{ |
|
|
|
target, |
|
|
|
logLevel: "debug", |
|
|
|
changeOrigin: true, |
|
|
|
cookieDomainRewrite: true, |
|
|
|
onProxyReq(proxyReq) { |
|
|
|
if (proxyReq.getHeader("origin")) { |
|
|
|
proxyReq.setHeader("origin", target) |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
) |
|
|
|
|
|
|
|
const production = !process.env.ROLLUP_WATCH |
|
|
|
|
|
|
|
const lodash_fp_exports = [ |
|
|
|
@ -230,11 +204,6 @@ export default { |
|
|
|
// Watch the `dist` directory and refresh the
|
|
|
|
// browser on changes when not in production
|
|
|
|
!production && livereload(outputpath), |
|
|
|
!production && |
|
|
|
browsersync({ |
|
|
|
server: outputpath, |
|
|
|
middleware: [apiProxy, _builderProxy], |
|
|
|
}), |
|
|
|
|
|
|
|
// If we're building for production (npm run build
|
|
|
|
// instead of npm run dev), minify
|
|
|
|
|