callstack / callstack/haul

Build times are too slow

Open
#479 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
3.7k
Forks
185
PR merge metrics
No merged PRs in 30d

Description

We have our source code written in TS and we use `haul@1.0.0-rc.7` along with `awesome-typescript-loader` and `babel-loader` for our RN app. The build is too slow for both the first build and when changes are made to a single component. The initial build time is okay, but the incremental changes are too slow for normal use.

```
First build 2m13s71
Change component 0m14s10
Revert change 0m13s12
```

### Current Behavior
The initial build and incremental changes take too long.

### Expected Behavior
The initial build should preferably be fast. Incremental changes need to be considerably faster.

### Haul Configuration (webpack.haul.js)
```js
const path = require('path');

const appDir = path.resolve(__dirname, '..');

const paths = {
appSrc: path.resolve(appDir, 'src'),
nodeModules: path.resolve(appDir, 'node_modules'),
};

module.exports = ({ platform }, { module, resolve }) => {
return {
entry: path.resolve(paths.appSrc, 'index.native.tsx'),

devtool: 'inline-source-map',

module: {
...module,
rules: [
{
test: /\.tsx?$/,
loader: 'awesome-typescript-loader',
options: {
transpileOnly: true,
},
},
{
test: /\.(js|jsx|mjs)$/,
include: [
paths.nodeModules,
],
loader: 'babel-loader',
options: {
compact: true,
},
},
...module.rules,
],
},

resolve: {
...resolve,
extensions: [
`.${platform}.ts`, `.${platform}.tsx`,
'.native.ts', '.native.tsx',
'.ts', '.tsx',
...resolve.extensions,
],
},

};
};

```

### Your Environment

| software | version
| ---------------- | -------
| Haul | 1.0.0-rc.7
| react-native | 0.53.0
| node | 8.4.0
| npm or yarn | 0.27.5

I tried using cache with `awesome-typescript-loader` via `happypack` and `cacheloader`, but it didn't make any noticeable changes. I also verified that `babel-loader` is writing to the disk cache.

Is the build times to be expected or can they be made faster? Any help would be greatly helpful.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.