mirror of
https://github.com/wasp-lang/wasp.git
synced 2024-12-27 19:14:52 +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'
|
||||
|
||||
export default [
|
||||
createBundle('src/server.ts', 'bundle/server.js'),
|
||||
{=# areDbSeedsDefined =}
|
||||
createBundle('src/dbSeed.ts', 'bundle/dbSeed.js'),
|
||||
{=/ areDbSeedsDefined =}
|
||||
]
|
||||
|
||||
function createBundle(inputFilePath, outputFilePath) {
|
||||
|
@ -50,7 +50,7 @@ import Wasp.Generator.ServerGenerator.Auth.OAuthAuthG (depsRequiredByPassport)
|
||||
import Wasp.Generator.ServerGenerator.AuthG (genAuth)
|
||||
import qualified Wasp.Generator.ServerGenerator.Common as C
|
||||
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.JsImport (extImportToImportJson, getAliasedJsImportStmtAndIdentifier)
|
||||
import Wasp.Generator.ServerGenerator.OperationsG (genOperations)
|
||||
@ -66,7 +66,7 @@ genServer spec =
|
||||
sequence
|
||||
[ genFileCopy [relfile|README.md|],
|
||||
genFileCopy [relfile|nodemon.json|],
|
||||
genFileCopy [relfile|rollup.config.js|],
|
||||
genRollupConfigJs spec,
|
||||
genTsConfigJson,
|
||||
genPackageJson spec (npmDepsForWasp spec),
|
||||
genNpmrc,
|
||||
@ -347,3 +347,12 @@ genOperationsMiddleware spec =
|
||||
(Just tmplData)
|
||||
where
|
||||
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,
|
||||
getPackageJsonPrismaSeedField,
|
||||
dbSeedNameEnvVarName,
|
||||
getDbSeeds,
|
||||
)
|
||||
where
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user