mirror of
https://github.com/Eugeny/tabby-web.git
synced 2026-08-18 07:16:03 +01:00
wip
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
require('dotenv').config()
|
||||
const baseConfig = require('./webpack.config.base.js')
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
@@ -12,6 +13,11 @@ const htmlPluginOptions = {
|
||||
|
||||
const outputPath = path.join(__dirname, 'build')
|
||||
const backendURL = process.env.BACKEND_URL
|
||||
|
||||
if (process.env.DEV && !backendURL) {
|
||||
backendURL = 'http://localhost:8001'
|
||||
}
|
||||
|
||||
if (!backendURL) {
|
||||
throw new Error('BACKEND_URL env var is required')
|
||||
}
|
||||
@@ -45,7 +51,7 @@ module.exports = {
|
||||
}),
|
||||
{
|
||||
apply: (compiler) => {
|
||||
compiler.hooks.afterEmit.tap('AfterEmitPlugin', _ => {
|
||||
compiler.hooks.afterEmit.tap('AfterEmitPlugin', () => {
|
||||
fs.writeFileSync(path.join(outputPath, 'config.json'), JSON.stringify({
|
||||
backendURL,
|
||||
}))
|
||||
|
||||
Reference in New Issue
Block a user