-
Notifications
You must be signed in to change notification settings - Fork 337
Remove dist_to_clean from wrangler cleanup steps #255
Comments
Which dev directory did you use? |
The project I copied the template from was called "worker", but this folder was named "afs".
…On Sat, Jun 15 2019 at 2:39 AM, < ***@***.*** > wrote:
Which dev directory did you use?./worker will currently be removed I
believe (that's a bug).
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub (
#255
) , or mute the thread (
https://github.com/notifications/unsubscribe-auth/AAANQMYH2X43THTI7FFJJT3P2S2FBANCNFSM4HYNUDYQ
).
|
This is really strange, would we mind chatting on gchat? |
Is this resolved? it seemed the directory checked was |
You're actually seeing an artifact of my tab-completion attempt there, the folder was gone. Existing editor sessions couldn't save even after I recreated the folder. |
@xtuc Sure! I'll be around tomorrow or find a time on my calendar. |
@zackbloom can you link to a repo that we could use to reproduce? thanks! |
Yes I can!
|
Thanks @zackbloom The issue here is that your webpack configuration specifies the output path to be the root directory. I haven't dug into the source yet, but if you change your While we work on a fix, I'd recommend replacing your webpack config with the contents below
|
@sevki Could you take a look at how we want to fix this? I'm happy to tackle a fix, I'm just not quite sure what approach we want to take here. I've confirmed that this is the issue. Wranglerjs is returning |
As a user of Wrangler, I wasn't really exposed to webpack being used internally. I didn't think my webpack config would influence it's behavior at all, I just assumed I should put my output file at the location it expected.
Would it be possible to add a check which stopped the build if the directory already exists before it has created it? |
@zackbloom that's a good point, we should make it clearer in the docs that wrangler uses It does seem like the default wrangler webpack template doesn't create a webpack.config file, and you would need to create your own if you wanted to do anything requiring a specific loader for things like es6 modules. We'll likely need to discuss what the right path is here before moving forward on a fix. |
This comment has been minimized.
This comment has been minimized.
Hm, this seems like a separate bug. While wrangler generates a I think this issue points to a broader problem with how wrangler handles webpack builds. We allow custom webpack config files, but in our generated projects we do not expose the webpack configuration used to build their project. I think the correct way to do this is to create a sensible default webpack config that the user can then modify/replace. This would eliminate the need to do any cleanup at all, we could leave the build artifacts where they are. This would also allow users to interact with tools like cloudworker. |
Got you, that's right.
We cleaned the webpack artifact, not the worker ones. I doubt cloudworker will be able to take advatange of webpack's output, however the watching might. I think the right solution is to implement #116 so that no webpack dist is only visible for the watch mode. It related to #206 because the worker output should be configurable, it's persistent already. |
Ooh, we don't clean the build artifact, got it. Is there any reason we don't just use the Edit: Perhaps it would be good to sit down and discuss |
Some solutions I've thought of:
|
I would suggest doing an RFC for this issue and #206. |
Hello! I attempted to run a preview on a project I was working on. This project has an independent webpack build, so I configured webpack to output to an index.js file in the root of the project and copied over a wrangler.toml file from the generator. When I went to preview, Wrangler deleted my dev directory, erasing any of the files I didn't have open elsewhere.
The text was updated successfully, but these errors were encountered: