@startupjs/bundler
Opinionated scripts and configs to develop a react-native-web project
Last updated a day ago by yska .
MIT · Original npm · Tarball · package.json
$ cnpm install @startupjs/bundler 
SYNC missed versions from official npm registry.

startupjs bundler

Opinionated scripts and configs to develop a react-native-web project

Usage

TBD

Async chunks support

Pass ASYNC=1 env var when building to enable the asynchronous chunks support. This will make each node module from /node_modules/ and each component from the /components/ folder to be its own small chunk loaded asynchronously.

This is useful when you are using dynamic import() in your code.

When the ASYNC=1 is passed, the files with the extension .async.js will take priority over the plain .js files. This enables you to move the asynchronous dynamic import() statements into their own files.

Duplicating your dependencies in .js and .async.js files enables you to have your codebase running in environments which don't support the dynamic import() yet, for example the react-native Metro builder.

Your production server must have HTTP/2 support, otherwise you'll have a connection limit of around 6 connections per hostname and you will notice your website loading VERY SLOOOOW in production (if you set the Network Throttling to Slow 3G).

If you use Google Load Balancer and serve your content through HTTPS, then you already have the HTTP/2 enabled without having to handle HTTP/2 in your Node.js app:

https://cloudplatform.googleblog.com/2015/10/Full-Speed-Ahead-with-HTTP2-on-Google-Cloud-Platform.html

https://ma.ttias.be/view-http-spdy-http2-protocol-google-chrome/

Export from stylus and css files

We can export variables directly from stylus into js. Here is an example:

  1. In ShoppingCart/index.styl file:
// allow overrides from global configuration
$this = merge({
  bgColor: $UI.colors.primary,
  height: 10u
}, $UI.ShoppingCart, true)

.root
  height: $this.height
  background-color: $this.bgColor

:export
  config: $this
  colors: $UI.colors
  foobar: 42
  1. Now import variables colors, config and foobar in the ShoppingCart/index.js file:
import STYLES from './index.styl'

const {
  config: { bgColor },
  colors,
  foobar
} = STYLES

export default function ShoppingCart () {
  console.log('Background color is:', bgColor)
  console.log('Available colors:', colors)
  console.log('Magic number FooBar:', foobar)
  return <View styleName='root' />
}

MIT Licence

Copyright (c) 2018 Pavel Zhukov

Current Tags

  • 0.22.0-canary.0                                ...           canary (3 months ago)
  • 0.23.45                                ...           latest (a day ago)
  • 0.22.0-alpha.36                                ...           next (4 months ago)

99 Versions

  • 0.23.45                                ...           a day ago
  • 0.23.44                                ...           a day ago
  • 0.23.43                                ...           21 days ago
  • 0.23.41                                ...           23 days ago
  • 0.23.40                                ...           24 days ago
  • 0.23.39                                ...           a month ago
  • 0.23.37                                ...           a month ago
  • 0.23.36                                ...           a month ago
  • 0.23.33                                ...           a month ago
  • 0.23.27                                ...           2 months ago
  • 0.23.20                                ...           2 months ago
  • 0.23.19                                ...           2 months ago
  • 0.23.18                                ...           2 months ago
  • 0.23.17                                ...           3 months ago
  • 0.23.16                                ...           3 months ago
  • 0.23.15                                ...           3 months ago
  • 0.23.13                                ...           3 months ago
  • 0.23.12                                ...           3 months ago
  • 0.23.11                                ...           3 months ago
  • 0.23.8                                ...           3 months ago
  • 0.23.7                                ...           3 months ago
  • 0.23.5                                ...           3 months ago
  • 0.23.4                                ...           3 months ago
  • 0.23.3                                ...           3 months ago
  • 0.23.0                                ...           3 months ago
  • 0.22.11                                ...           3 months ago
  • 0.22.9                                ...           3 months ago
  • 0.22.2                                ...           3 months ago
  • 0.22.0                                ...           3 months ago
  • 0.22.0-canary.0                                ...           3 months ago
  • 0.22.0-alpha.36                                ...           4 months ago
  • 0.22.0-alpha.35                                ...           4 months ago
  • 0.22.0-alpha.33                                ...           4 months ago
  • 0.22.0-alpha.30                                ...           4 months ago
  • 0.22.0-alpha.29                                ...           4 months ago
  • 0.22.0-alpha.28                                ...           4 months ago
  • 0.22.0-alpha.27                                ...           4 months ago
  • 0.22.0-alpha.26                                ...           4 months ago
  • 0.22.0-alpha.24                                ...           4 months ago
  • 0.22.0-alpha.23                                ...           4 months ago
  • 0.22.0-alpha.22                                ...           4 months ago
  • 0.22.0-alpha.20                                ...           4 months ago
  • 0.22.0-alpha.18                                ...           5 months ago
  • 0.22.0-alpha.9                                ...           5 months ago
  • 0.22.0-alpha.3                                ...           5 months ago
  • 0.22.0-alpha.1                                ...           5 months ago
  • 0.22.0-alpha.0                                ...           5 months ago
  • 0.21.1                                ...           5 months ago
  • 0.21.0                                ...           5 months ago
  • 0.20.0                                ...           5 months ago
  • 0.19.2                                ...           5 months ago
  • 0.19.1                                ...           5 months ago
  • 0.19.0                                ...           6 months ago
  • 0.18.4                                ...           6 months ago
  • 0.18.3                                ...           6 months ago
  • 0.18.2                                ...           6 months ago
  • 0.18.1                                ...           6 months ago
  • 0.18.0                                ...           6 months ago
  • 0.17.3                                ...           6 months ago
  • 0.17.2                                ...           6 months ago
  • 0.17.0                                ...           6 months ago
  • 0.16.2                                ...           6 months ago
  • 0.16.0                                ...           6 months ago
  • 0.15.8                                ...           7 months ago
  • 0.15.5                                ...           7 months ago
  • 0.15.4                                ...           7 months ago
  • 0.15.0                                ...           7 months ago
  • 0.14.7                                ...           7 months ago
  • 0.14.4                                ...           8 months ago
  • 0.14.1                                ...           8 months ago
  • 0.14.0                                ...           8 months ago
  • 0.14.0-alpha.0                                ...           8 months ago
  • 0.13.0                                ...           8 months ago
  • 0.12.0                                ...           8 months ago
  • 0.11.0                                ...           9 months ago
  • 0.10.1                                ...           10 months ago
  • 0.10.0                                ...           10 months ago
  • 0.9.14                                ...           10 months ago
  • 0.9.12                                ...           10 months ago
  • 0.9.6                                ...           10 months ago
  • 0.10.0-alpha.0                                ...           10 months ago
  • 0.9.0                                ...           10 months ago
  • 0.8.1                                ...           a year ago
  • 0.8.0                                ...           a year ago
  • 0.7.1                                ...           a year ago
  • 0.7.0                                ...           a year ago
  • 0.6.0                                ...           a year ago
  • 0.5.2                                ...           a year ago
  • 0.5.0                                ...           a year ago
  • 0.4.1                                ...           a year ago
  • 0.4.0                                ...           a year ago
  • 0.3.15                                ...           a year ago
  • 0.3.13                                ...           a year ago
  • 0.3.3                                ...           a year ago
  • 0.3.2                                ...           a year ago
  • 0.3.1                                ...           a year ago
  • 0.3.0                                ...           a year ago
  • 0.2.0                                ...           a year ago
  • 0.1.15                                ...           a year ago

Copyright 2014 - 2016 © taobao.org |