# Deployment with au-cli

**URL:** <https://discourse.aurelia.io/t/deployment-with-au-cli/2982>\
**Category:** Uncategorized\
**Created:** [October 10, 2019, 9:37am UTC](https://discourse.aurelia.io/t/deployment-with-au-cli/2982 "2019-10-10T09:37:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![funky\_guitarist](https://avatars.discourse-cdn.com/v4/letter/f/858c86/32.png) [@funky\_guitarist](https://discourse.aurelia.io/u/funky_guitarist)\
**Post date:** [October 10, 2019, 9:37am UTC](https://discourse.aurelia.io/t/deployment-with-au-cli/2982/1 "2019-10-10T09:37:58Z")

</div>

Hello, I m new to Aurelia and webpack.  
I made a new project with au-cli. On the local server it s running.  
when I run au build --prod env I get a lot of files in the dist folder.  
the file extension is .chunk.js Now when I load up the files to the server on the internet nothing works. Not even the hello world example. the console in the browser is complaining that some files could not be loaded and others have the wrong mime type.  
i am a Webpack beginner, so maybe someone can help with this problem. my expected output for the build would be  
one index.html file and one .js file.  
any help greatly appreciated  
cheers. mark

---

<div class="post-metadata">

**Author:** ![YardGnomeNinja](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/yardgnomeninja/32/689_2.png) [@YardGnomeNinja](https://discourse.aurelia.io/u/YardGnomeNinja)\
**Post date:** [October 10, 2019, 2:03pm UTC](https://discourse.aurelia.io/t/deployment-with-au-cli/2982/2 "2019-10-10T14:03:31Z")

</div>

Hey @funky_guitarist, welcome to the community! 😃

I’m by no means a Webpack expert, and calling me a novice may be giving me too much credit , but I thought I’d try to help you figure this out. Can you paste the `output: { }` bit of the project’s webpack.config.js? I’m wondering if something isn’t funky there for some reason.

Here’s what I’ve currently got in my project, for sake of comparison:

```auto
output: {
    path: outDir,
    publicPath: baseUrl,
    filename: production ? '[name].[chunkhash].bundle.js' : '[name].[hash].bundle.js',
    sourceMapFilename: production ? '[name].[chunkhash].bundle.map' : '[name].[hash].bundle.map',
    chunkFilename: production ? '[name].[chunkhash].chunk.js' : '[name].[hash].chunk.js'
  }
```

---

<div class="post-metadata">

**Author:** ![huochunpeng](https://avatars.discourse-cdn.com/v4/letter/h/49beb7/32.png) [@huochunpeng](https://discourse.aurelia.io/u/huochunpeng)\
**Post date:** [October 10, 2019, 10:01pm UTC](https://discourse.aurelia.io/t/deployment-with-au-cli/2982/3 "2019-10-10T22:01:27Z")

</div>

The dist/ folder contains the final index.html and other resources like js bundles. Those files are the whole app structure, to be deployed to the “root” folder of your production app on server, NOT dist folder on server.

One thing you can try is:

1. cd to dist folder
2. boot up a simple web server to just serve static files. For example something like [http-server](https://github.com/http-party/http-server) (beware it got [problem](https://github.com/http-party/http-server/issues/525) on win10 right now).
3. check if the app runs as expected.

---

<div class="post-metadata">

**Author:** ![funky\_guitarist](https://avatars.discourse-cdn.com/v4/letter/f/858c86/32.png) [@funky\_guitarist](https://discourse.aurelia.io/u/funky_guitarist)\
**Post date:** [October 11, 2019, 10:25am UTC](https://discourse.aurelia.io/t/deployment-with-au-cli/2982/4 "2019-10-11T10:25:22Z")

</div>

thank you for your prompt reply

heres my weback.config.js. I can spot no difference.  
maybe you?

```
output: {
path: outDir,
publicPath: baseUrl,
filename: production ? '[name].[chunkhash].bundle.js' : '[name].[hash].bundle.js',
sourceMapFilename: production ? '[name].[chunkhash].bundle.map' : '[name].[hash].bundle.map',
chunkFilename: production ? '[name].[chunkhash].chunk.js' : '[name].[hash].chunk.js'

```

},

---

<div class="post-metadata">

**Author:** ![funky\_guitarist](https://avatars.discourse-cdn.com/v4/letter/f/858c86/32.png) [@funky\_guitarist](https://discourse.aurelia.io/u/funky_guitarist)\
**Post date:** [October 11, 2019, 10:29am UTC](https://discourse.aurelia.io/t/deployment-with-au-cli/2982/5 "2019-10-11T10:29:11Z")

</div>

hi and thank you for ansering me.  
I put the files from the dist folder into the root folder on my server so that can not be the problem.

---

<div class="post-metadata">

**Author:** ![YardGnomeNinja](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/yardgnomeninja/32/689_2.png) [@YardGnomeNinja](https://discourse.aurelia.io/u/YardGnomeNinja)\
**Post date:** [October 11, 2019, 12:33pm UTC](https://discourse.aurelia.io/t/deployment-with-au-cli/2982/6 "2019-10-11T12:33:45Z")

</div>

Thought that might be a long shot. Looks good to me.

I just noticed in your original post you state you run `au build --prod env`. Is this what you are actually executing or was it a typo? The command should be `au build --env prod`. I tried `au build --prod env` on a project I’m working on and it does build, though I didn’t test it. I’m guessing the CLI ignores the `--prod` argument since it’s not recognized. I would still expect it to work, but maybe try `au build --env prod` and see if that works out.
