You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bundle-* commands don't support the purs --output option #216
...because although it compiles the .purs files into outputDir, It then runs the purs bundle command with "output" hardcoded:
Running command: `purs bundle "output/*/*.js" -m Main --main Main -o index.js`
purs bundle: No input files.
I guess the solution would be either to detect the --output/-o args passed to the purs compiler, or possibly to add an --output option to spago itself? An entry in spago.dhall would also be nice, if you're going that way.
And yeah I agree with your analysis, we could either detect the --output in the args being passed to purs, or if this is too tricky we can add the --output flag to all the relevant commands, so we could just use that for everything. (I guess the question in this case would be "but what happens when we pass the --output to purs but the user also adds it as an extra argument for purs?")
I think adding adding an entry to spago.dhall is also a good idea, but a proper handling of the flags is necessary either way (because e.g. you might want to override the config value with a flag)
Good points. This kinda opened up a can of worms 😃, but after having thought through all the options, I think it's fairly simple.
Currently, args specified after -- don't get added to the purs bundle command, only to purs compile I don't know if this was a conscious decision, but I think it should stay this way for simplicity (at least for now).
There are however two purs bundle options not currently supported by spago (--namespace and --source-maps), but I think that's ok; you can say: spago bundle-* is just a convenience command. If you want all the options, you can do spago build && purs bundle ... instead.
If there's config option for the output dir in spago.dhall, I guess I don't really also need an --output arg for spago? (Since all it does is save a few characters over -- --output, which I can use if I really need to override the config).
So it's then just detecting use of -- --output in the bundle- commands too.
Activity
f-f commentedon May 27, 2019
@stkb great catch!
And yeah I agree with your analysis, we could either detect the
--outputin the args being passed to purs, or if this is too tricky we can add the--outputflag to all the relevant commands, so we could just use that for everything. (I guess the question in this case would be "but what happens when we pass the--outputtopursbut the user also adds it as an extra argument for purs?")I think adding adding an entry to
spago.dhallis also a good idea, but a proper handling of the flags is necessary either way (because e.g. you might want to override the config value with a flag)stkb commentedon May 27, 2019
Good points. This kinda opened up a can of worms 😃, but after having thought through all the options, I think it's fairly simple.
Currently, args specified after
--don't get added to thepurs bundlecommand, only topurs compileI don't know if this was a conscious decision, but I think it should stay this way for simplicity (at least for now).There are however two
purs bundleoptions not currently supported by spago (--namespaceand--source-maps), but I think that's ok; you can say:spago bundle-*is just a convenience command. If you want all the options, you can dospago build && purs bundle ...instead.If there's config option for the output dir in
spago.dhall, I guess I don't really also need an--outputarg for spago? (Since all it does is save a few characters over-- --output, which I can use if I really need to override the config).So it's then just detecting use of
-- --outputin the bundle- commands too.I guess I could have a go at this.
coot commentedon Jun 13, 2020
zephyr reads from
outputwrites todce-output; it would be nice if:would read from the output directory to create the bundle.
f-f commentedon Jun 13, 2020
Yes! These days we even sort-of-detect when the
--outputoption is provided as a purs arg, so we could:outputflag to spago itself--outputflag insteadf-f commentedon Sep 16, 2023
All commands that perform a build now support the
--outputoption