This project is highly influenced by the Create React App. I thank its authors.
npm install -g create-js-app create-js-app create my-app cd my-app/ npm start
This will open your application in a browser (or you can navigate to http://localhost:3000.
When you’re ready to deploy to production, create a minified bundle with
npm run build.
This project is currently under occassional development. This means that if I encounter a bug, or if a new simple feature comes to mind, I will be continuing to work on it.
I am using this project at my work actively with features that are currently available (and these features are all I need for now).
You can create your own plugins or templates easily if there is something you miss.
# using npm npm install -g create-js-app # using yarn yarn global add create-js-app
This command will install
You will need to have Node >= 6.0 on you machine
You have two options of how to create an application. The first one is creating an application using default project template (which is using js-app-plugin-universal-webpack under the hood) and the second is creating an application using a template of your own choosing.
1. Creating an application
Create a new project with default template**
create-js-app create <project-directory-to-create>
This will create a project with default template
js-app-template-universal which is suitable for creating universal React application.
create-js-app create my-app cd my-app/
Create a new project with custom template
create-js-app create <project-directory-to-create> --template <package-name>
This will create a project with a template of your own choosing.
create-js-app create my-app --template js-app-plugin-universal-webpack cd my-app/
2. Develop and test the application
There are only two commands you need during the development:
npm run start and
npm run test.
First you need to develop your application. To start the development mode you need to run following command in a project directory.
This will start your application. If you are using default project template then it opens the application in your browser.
During development you may need to test your application. In this case use the following command.
This command will start the jest test runner in watch mode (any change detected in source files will trigger tests).
For advanced users
Running in CI
Test command will detect if
process.env.CI is set, if it is so then it runs tests only once.
Tests environment (
test command runs tests in
jsdom environment. If you want to change it to node please use it with the
--node argument like this
npm run test -- --node.
3. Deploy to production
When you are done with development or you have reached a feature set that can be deployed. Just run the following command to get a minified build of your application.
npm run build
This will generate a
build directory which contains everything you need to run your application.
If you are using a custom template and not the
js-app-template-universal please make sure that the build destination is the same. This destination can differ if the template is using some custom plugin.
- Creating your own plugin [TODO]
If this project does not fulfill your needs, you might want to explore alternatives. Some of the more popular ones are: