# Aurelia and webpack with both .js and .ts

**URL:** <https://discourse.aurelia.io/t/aurelia-and-webpack-with-both-js-and-ts/4683>\
**Category:** Help Requests\
**Created:** [March 10, 2022, 1:00pm UTC](https://discourse.aurelia.io/t/aurelia-and-webpack-with-both-js-and-ts/4683 "2022-03-10T13:00:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![roddharris](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/roddharris/32/1340_2.png) [@roddharris](https://discourse.aurelia.io/u/roddharris)\
**Post date:** [March 10, 2022, 1:00pm UTC](https://discourse.aurelia.io/t/aurelia-and-webpack-with-both-js-and-ts/4683/1 "2022-03-10T13:00:25Z")

</div>

If I use the cli (v1.3.1) to set up a TypeScript app, and then drop some .js files in the src directory (old code from another project) the production build fails when it hits the .js files. If I convert them to .ts, everything goes well.

Is it possible to change the default webpack configuration generated by the cli to include .js files so they also get bundled along with the typescript? If so, what do I need to do to make that happen?

---

<div class="post-metadata">

**Author:** ![bigopon](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/bigopon/32/18_2.png) [@bigopon](https://discourse.aurelia.io/u/bigopon)\
**Post date:** [March 11, 2022, 5:18am UTC](https://discourse.aurelia.io/t/aurelia-and-webpack-with-both-js-and-ts/4683/2 "2022-03-11T05:18:32Z")

</div>

Probably in 2 places:

- `tsconfig.json`: add `allowJs: true` to the `compilerOptions`
- `webpack.config.js`: enusre the `resolve.extensions` includes `['.js']` (which it probably already does, just double check)

You can find out more about `resolve.extensions` on webpack doc website.
