README.md in sewing_kit-0.97.1 vs README.md in sewing_kit-0.97.2
- old
+ new
@@ -68,9 +68,28 @@
# reduce development mode's memory usage)
config.development_options[:source_maps] = 'off'
end
```
+## Configuring production builds
+
+`SewingKit.configure` provides a `build_options` attribute that adjusts the behaviour of sewing-kit's build. See [the `build` command's documentation](/docs/commands/build.md#options) for a full list of options.
+
+### Usage
+
+```rb
+# config/initializers/sewing_kit.rb
+SewingKit.configure do |config|
+ config.build_options = {
+ # Disable type checks for faster, low memory builds (TypeScript only)
+ # Note: you *must* have a separate `yarn sewing-kit type-check` CI step for this to be viable.
+ type_check: false,
+ # Increase heap to accommodate webpack's space for source map generation
+ heap: 2000
+ }
+end
+```
+
## Testing the front end
For fast tests with consistent results, test front-end components using Jest instead of Rails integration tests.
Use [`sewing-kit test`](https://github.com/Shopify/sewing-kit/blob/master/docs/commands/test.md#L3) to run all `.test.tsx` files in the `app/ui` directory. [Jest](https://jestjs.io) is used as a test runner, with customization available via [its sewing-kit plugin](https://github.com/Shopify/sewing-kit/blob/master/docs/plugins/jest.md).