mirror of
https://github.com/wasp-lang/wasp.git
synced 2024-12-28 11:34:41 +03:00
Fixes bundler setup (#1728)
This commit is contained in:
parent
dbc2a7f5ea
commit
985825bcd8
@ -1,8 +1,11 @@
|
|||||||
|
{{={= =}=}}
|
||||||
import esbuild from 'rollup-plugin-esbuild'
|
import esbuild from 'rollup-plugin-esbuild'
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
createBundle('src/server.ts', 'bundle/server.js'),
|
createBundle('src/server.ts', 'bundle/server.js'),
|
||||||
|
{=# areDbSeedsDefined =}
|
||||||
createBundle('src/dbSeed.ts', 'bundle/dbSeed.js'),
|
createBundle('src/dbSeed.ts', 'bundle/dbSeed.js'),
|
||||||
|
{=/ areDbSeedsDefined =}
|
||||||
]
|
]
|
||||||
|
|
||||||
function createBundle(inputFilePath, outputFilePath) {
|
function createBundle(inputFilePath, outputFilePath) {
|
||||||
|
@ -50,7 +50,7 @@ import Wasp.Generator.ServerGenerator.Auth.OAuthAuthG (depsRequiredByPassport)
|
|||||||
import Wasp.Generator.ServerGenerator.AuthG (genAuth)
|
import Wasp.Generator.ServerGenerator.AuthG (genAuth)
|
||||||
import qualified Wasp.Generator.ServerGenerator.Common as C
|
import qualified Wasp.Generator.ServerGenerator.Common as C
|
||||||
import Wasp.Generator.ServerGenerator.CrudG (genCrud)
|
import Wasp.Generator.ServerGenerator.CrudG (genCrud)
|
||||||
import Wasp.Generator.ServerGenerator.Db.Seed (genDbSeed, getPackageJsonPrismaSeedField)
|
import Wasp.Generator.ServerGenerator.Db.Seed (genDbSeed, getDbSeeds, getPackageJsonPrismaSeedField)
|
||||||
import Wasp.Generator.ServerGenerator.JobGenerator (depsRequiredByJobs, genJobExecutors, genJobs)
|
import Wasp.Generator.ServerGenerator.JobGenerator (depsRequiredByJobs, genJobExecutors, genJobs)
|
||||||
import Wasp.Generator.ServerGenerator.JsImport (extImportToImportJson, getAliasedJsImportStmtAndIdentifier)
|
import Wasp.Generator.ServerGenerator.JsImport (extImportToImportJson, getAliasedJsImportStmtAndIdentifier)
|
||||||
import Wasp.Generator.ServerGenerator.OperationsG (genOperations)
|
import Wasp.Generator.ServerGenerator.OperationsG (genOperations)
|
||||||
@ -66,7 +66,7 @@ genServer spec =
|
|||||||
sequence
|
sequence
|
||||||
[ genFileCopy [relfile|README.md|],
|
[ genFileCopy [relfile|README.md|],
|
||||||
genFileCopy [relfile|nodemon.json|],
|
genFileCopy [relfile|nodemon.json|],
|
||||||
genFileCopy [relfile|rollup.config.js|],
|
genRollupConfigJs spec,
|
||||||
genTsConfigJson,
|
genTsConfigJson,
|
||||||
genPackageJson spec (npmDepsForWasp spec),
|
genPackageJson spec (npmDepsForWasp spec),
|
||||||
genNpmrc,
|
genNpmrc,
|
||||||
@ -347,3 +347,12 @@ genOperationsMiddleware spec =
|
|||||||
(Just tmplData)
|
(Just tmplData)
|
||||||
where
|
where
|
||||||
tmplData = object ["isAuthEnabled" .= (isAuthEnabled spec :: Bool)]
|
tmplData = object ["isAuthEnabled" .= (isAuthEnabled spec :: Bool)]
|
||||||
|
|
||||||
|
genRollupConfigJs :: AppSpec -> Generator FileDraft
|
||||||
|
genRollupConfigJs spec =
|
||||||
|
return $
|
||||||
|
C.mkTmplFdWithData [relfile|rollup.config.js|] (Just tmplData)
|
||||||
|
where
|
||||||
|
tmplData = object ["areDbSeedsDefined" .= areDbSeedsDefined]
|
||||||
|
|
||||||
|
areDbSeedsDefined = maybe False (not . null) $ getDbSeeds spec
|
||||||
|
@ -2,6 +2,7 @@ module Wasp.Generator.ServerGenerator.Db.Seed
|
|||||||
( genDbSeed,
|
( genDbSeed,
|
||||||
getPackageJsonPrismaSeedField,
|
getPackageJsonPrismaSeedField,
|
||||||
dbSeedNameEnvVarName,
|
dbSeedNameEnvVarName,
|
||||||
|
getDbSeeds,
|
||||||
)
|
)
|
||||||
where
|
where
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user