@aquestsrl/create-app-cli

This package provides a cli interface for build Universal Javascript application.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@aquestsrl/create-app-cli
1.12.64 years ago6 years agoMinified + gzip package size for @aquestsrl/create-app-cli in KB

Readme

@aquestsrl/create-app-cli
This package provides a cli interface for develop Universal Node application with no build configuration.
The goal is to keep configuration files separate from development files.
- Features - Installation - Create new app - Development - Build - Available options - Extends Webpack configuration - Extends Loaders configuration

Features

  • HMR Server and Client side
  • HMR Style with css-hot-loader
  • Custom Webpack logger
  • Completely configurable and extensible
  • Framework agnostic

Installation

Install package globally (it is assumed you are logged in NPM)
npm install @aquestsrl/create-app-cli -g
// or
yarn global add @aquestsrl/create-app-cli
If you receive a permission error, check your ~/.npmrc:
@aquestsrl:registry=https://registry.npmjs.org/
//registry.npmjs.org/:_authToken=YOUR_TOKEN

Create new app

If you have previously installed a starter kit, navigate to an empty folder and type this command to launch configuration wizard:
create-app
Answer to this questions:
Select your default npm client
Project name
Project description
Select a starter-kit

That's all!
Read here how to write your boilerplate.

Development

Type this command to launch dev server:
create-app dev

Build

Type this command to build your application:
create-app build
If you have more than one production configuration on your create-app.config.json, use --env option:
create-app build --env production-local

Available options

Show usage guide
create-app -h

Show package version
create-app -v

Use a configuration from create-app.config.json
create-app build --env production-local

Extends Webpack configuration

Create create-app.webpack-config.js on your project root for extends the default configuration.
webpack-merge will be used to merge objects.
This module receive an object with this arguments:
| Name | Type | Description |-----|-------------|------|-------------| | NODEENV | String | Current process.env.NODE_ENV value | SERVER | Boolean | Determine if is a server configuration
Example:
module.exports = ({ NODE_ENV, SERVER }) => {
  if (!SERVER) {
    return {
      module: {
        rules: [
          {
            test: /\.(frag|vert)$/,
            loaders: [
              'raw-loader',
              'glslify-loader',
            ],
          },
        ],
      },
    };
  }
};

Extends Loaders configuration

Create create-app.loaders-config.js on your project root for extends the default loaders configuration.
webpack-merge
will be used to merge objects.
This module receive an object with this arguments:
| Name | Type | Description |-----|-------------|------|-------------| | NODEENV | String | Current process.env.NODE_ENV value | SERVER | Boolean | Determine if is a server configuration
Example:
module.exports = () => ({
	scss: {
		data: `
			@import 'variables';
			@import 'utilities/_flexbox';
		`,
	},
	js: { presets: [require('@babel/preset-react').default] },
});