2.0.0-beta.4 • Published 3 years ago

catalyst v2.0.0-beta.4

Weekly downloads
138
License
MIT
Repository
github
Last release
3 years ago

🧪 Catalyst · CircleCI

Catalyst is an opinionated tool for creating and maintaining React applications. It sets up webpack, TypeScript, React, Apollo, SASS, Autoprefixer, and more!

Starting a New Project

$ yarn add catalyst
$ yarn run catalyst init

Starting the Development Server

You can start the development server with:

$ NODE_ENV=development yarn run catalyst server

By default, the server will be accessible at http://localhost:8080. You can override this by setting DEV_SERVER_PROTOCOL, DEV_SERVER_HOST and/or DEV_SERVER_PORT environment variables.

If you want to be able to access your development server from other devices on your local network, you can start it like this:

$ DEV_SERVER_HOST=`ipconfig getifaddr en0` yarn start

Where en0 is the network device you're using.

Integrating with Rails

See: https://github.com/friendsoftheweb/catalyst-rails

Configuration

Certain aspects of Catalyst can be configured by editing the catalyst.config.json file in the root of your project. Some options can also be configured via environment variables (which take precedence over the value in catalyst.config.json). The server must be restarted before any changes to the configuration will take effect.

KeyEnvironment VariableTypeDescription
contextPathN/AstringThe path (relative to the root of your project) that webpack should treat as the context when requiring modules and assets.
buildPathN/AstringThe path (relative to the root of your project) where test and production builds will be output.
publicPathN/AstringThe the base URI used when generating paths for <script /> and <link /> tags.
overlayEnabledN/AbooleanDisplay a custom overlay that shows build status, build errors, and runtime errors. This only applies to the development environment.
prebuiltPackagesN/Astring[]A list of npm packages which should be pre-built in the development environment. This decreases the time spent on re-building entries by skipping the listed packages.
transformedPackagesN/Astring[]A list of npm packages which should be transformed and polyfilled via Babel.
generateServiceWorkerN/AbooleanGenerate a separate file which will be registered as a SeviceWorker and preload JavaScript, CSS, and other assets.
checkForCircularDependenciesN/AbooleanShow warnings in development and errors in other in environments if a circular dependency is detected.
checkForDuplicatePackagesN/AbooleanShow warnings if mulitple versions of the same package are required in the webpack dependency tree.
ignoredDuplicatePackagesN/Astring[]A list of npm packages to ignore when checking for duplicates. This has no effect if checkForDuplicatePackages is false.
devServerHostDEV_SERVER_HOSTstringThe host for the development server. Defaults to "localhost".
devServerPortDEV_SERVER_PORTnumberThe port for the development server. Defaults to 8080.
devServerProtocolDEV_SERVER_PROTOCOLstringThe protocol (e.g. "http" or "https") used for accessing the development server. Defaults to "http".
devServerCertificateN/A{ keyPath: string; certPath: string; caPath: string; }The certificate file paths for running the server with SSL support.

Configuring Webpack

Catalyst automatically creates a webpack configuration that should be sufficient for most projects. If a project does require manual webpack configuration, a webpack.config.js file can be added to the root of the project.

Catalyst exports a function which returns Catalyst's default webpack configuration as an object:

const { webpackConfig } = require('catalyst');

const customConfig = webpackConfig();

customConfig.module.rules.push({
  loader: 'my-custom-loader'
});

module.exports = customConfig;

Analyzing Webpack Output

The size of the bundles output by webpack can be vizualized using webpack-bundle-analyzer. You can open the analyzer by starting Catalyst server with the --bundle-analyzer option:

$ NODE_ENV=development yarn run catalyst server --bundle-analyzer
2.0.0-beta.14

3 years ago

2.0.0-beta.13

3 years ago

2.0.0-beta.12

3 years ago

2.0.0-beta.9

3 years ago

2.0.0-beta.8

3 years ago

2.0.0-beta.7

3 years ago

2.0.0-beta.6

3 years ago

2.0.0-beta.5

3 years ago

2.0.0-beta.4

3 years ago

2.0.0-beta.3

3 years ago

2.0.0-beta.2

3 years ago

1.2.0

3 years ago

2.0.0-beta.1

3 years ago

2.0.0-beta.0

3 years ago

2.0.0-alpha.8

3 years ago

2.0.0-alpha.7

3 years ago

2.0.0-alpha.6

3 years ago

2.0.0-alpha.5

3 years ago

2.0.0-alpha.4

3 years ago

2.0.0-alpha.3

3 years ago

2.0.0-alpha.2

3 years ago

2.0.0-alpha.1

3 years ago

2.0.0-alpha.0

3 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

5 years ago

1.0.0

5 years ago

1.0.0-beta.61

5 years ago

1.0.0-beta.60

5 years ago

1.0.0-beta.59

5 years ago

1.0.0-beta.58

5 years ago

1.0.0-beta.57

5 years ago

1.0.0-beta.56

5 years ago

1.0.0-beta.55

5 years ago

1.0.0-beta.54

5 years ago

1.0.0-beta.53

5 years ago

1.0.0-beta.52

5 years ago

1.0.0-beta.51

5 years ago

1.0.0-beta.50

5 years ago

1.0.0-beta.49

5 years ago

1.0.0-beta.48

5 years ago

1.0.0-beta.47

5 years ago

1.0.0-beta.46

5 years ago

1.0.0-beta.45

5 years ago

1.0.0-beta.44

5 years ago

1.0.0-beta.43

5 years ago

1.0.0-beta.42

5 years ago

1.0.0-beta.41

5 years ago

1.0.0-beta.40

6 years ago

1.0.0-beta.39

6 years ago

1.0.0-beta.37

6 years ago

1.0.0-beta.36

6 years ago

1.0.0-beta.35

6 years ago

1.0.0-beta.34

6 years ago

1.0.0-beta.33

6 years ago

1.0.0-beta.32

6 years ago

1.0.0-beta.31

6 years ago

1.0.0-beta.30

6 years ago

1.0.0-beta.29

6 years ago

1.0.0-beta.28

6 years ago

1.0.0-beta.27

6 years ago

1.0.0-beta.26

6 years ago

1.0.0-beta.25

6 years ago

1.0.0-beta.24

6 years ago

1.0.0-beta.23

6 years ago

1.0.0-beta.22

6 years ago

1.0.0-beta.21

6 years ago

1.0.0-beta.20

6 years ago

1.0.0-beta.19

6 years ago

1.0.0-beta.18

6 years ago

1.0.0-beta.17

6 years ago

1.0.0-beta.16

6 years ago

1.0.0-beta.15

6 years ago

1.0.0-beta.14

6 years ago

1.0.0-beta.13

6 years ago

1.0.0-beta.12

6 years ago

1.0.0-beta.11

6 years ago

1.0.0-beta.10

6 years ago

1.0.0-beta.9

6 years ago

1.0.0-beta.8

6 years ago

1.0.0-beta.7

6 years ago

1.0.0-beta.6

6 years ago

1.0.0-beta.5

6 years ago

1.0.0-beta.4

6 years ago

1.0.0-beta.3

6 years ago

1.0.0-beta.2

6 years ago

1.0.0-beta.1

6 years ago

0.1.0

11 years ago