Skip to content
CLI for Fusion.js
Branch: master
Clone or download
lxe and fusionjs-bot Add flags to optionally disable zopfli compression and minification
#761

Co-authored-by: Aleksey Smolenchuk <aleksey@uber.com>
Latest commit ae778bd Apr 23, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.buildkite
.github Add issue template (#231) Feb 16, 2018
bin Restructured all files in command/ (#428) Jul 17, 2018
build Add flags to optionally disable zopfli compression and minification Apr 23, 2019
commands Add flags to optionally disable zopfli compression and minification Apr 23, 2019
docs
entries
flow-typed Refactor tests, implement parallelized workers on CI (#647) Dec 11, 2018
lib Refactor tests, implement parallelized workers on CI (#647) Dec 11, 2018
plugins
test/e2e Revert change to server-startup-control timeout Apr 9, 2019
.codecov.yml Add codecov (#50) Dec 5, 2017
.eslintignore Refactor tests, implement parallelized workers on CI (#647) Dec 11, 2018
.eslintrc.js
.flowconfig Improve tests (#699) Feb 13, 2019
.gitignore Fix issue with coverage and gql macro Oct 23, 2018
.npmrc Add .npmrc (#342) Apr 19, 2018
Dockerfile
LICENSE Add initial implementation Nov 7, 2017
README.md fix testing with hoisted node_modules (#685) Jan 30, 2019
docker-compose.yml Refactor tests, implement parallelized workers on CI (#647) Dec 11, 2018
get-compilation-metadata.js Revert "Add cacheablePaths to context" Sep 13, 2018
get-test-files.js Fix jest test chunking (#728) Mar 11, 2019
jest.config.js Refactor tests, implement parallelized workers on CI (#647) Dec 11, 2018
package.json Release v1.18.3 (#760) Apr 16, 2019
renovate.json Update renovate.json Jan 12, 2018
sw.js Add bundling of service worker entry (#610) Jan 7, 2019
yarn.lock Update dependency flow-bin to ^0.95.0 Mar 21, 2019

README.md

fusion-cli

Build status

The CLI interface for Fusion.js

The fusion-cli package is responsible for orchestrating compile-time configuration for server and browser bundles, as well as development, test and production variations. It provides a standardized Babel configuration that includes async/await support as well as stage 3+ Ecmascript features.

Due to the complexity involved in configuring many permutations of configurations, Fusion.js does not support custom webpack.config. This design decision allows Fusion.js to eventually move away from Webpack if faster and better bundlers become available. Additionally, it allows Fusion.js to make changes to the internal webpack configuration without the concern of breaking users customizations. If you run into a situation where you feel you need to make a webpack customization, please reach out to us on slack or create an issue describing your use case.

The CLI is also responsible for hot module reloading in development mode, and for running the web server.

Installation

yarn add fusion-cli

CLI API

The CLI API can be most easily run through the Yarn or NPX CLI, e.g. yarn fusion build or npx fusion build.

  • fusion build [dir] [--production] [--log-level] Builds your application assets

    This command generates transpiled javascript/source map files (aka assets, artifacts) for browser and server. By default it builds development assets, but can also build test and production assets, given the respective flags.

    Build artifacts are stored in the .fusion directory.

    • --production: Build production assets
    • --log-level: Log level to output to console [default: "info"]
  • fusion dev [dir] [--port] [--no-hmr] [--test] [--log-level] [--forceLegacyBuild] Builds development assets and runs the application in development mode

    Note that this command only builds browser artifacts in memory, and it doesn't save them to the filesystem. This allows hot module reloading to occur faster since there's no performance cost due to I/O access.

    • --port: The port on which the application runs [default: 3000]
    • --no-hmr: Run without hot modules replacement
    • --test: Run tests as well as application
    • --log-level: Log level to output to console [default: "info"]
    • --forceLegacyBuild: Force enable legacy build. By default not compiled in dev.
    • --perserve-names: Disable name mangling during script minification

Webpack stats.json file

Building an app generates a .fusion/stats.json file, which can be used with webpack-bundle-analyzer

You can’t perform that action at this time.