@purfect/engine v0.2.0
Purfect engine
Abstraction over webpack and babel configuration so you don't need to deal with it. It is literraly 0-configuration package, just install and start developing your app.
The problem
I found myself doing porting and improving of webpack and babel configurations between FE apps which is extremely error prone, tedious and time consuming. Not to mention it takes lots of time to upgrade versions and implement all the changes afterwards.
The solution
Abstract away webpack and babel configuration under single package. Manage all versions, configuration and setup in a single place and ship all updates via single package update.
How to start?
npm install --save @purfect/engineoryarn add @purfect/engine- In your project's
package.jsonadd these scripts
"scripts": {
"start": "purfect-engine start",
"start:prod": "purfect-engine start:prod",
"build": "purfect-engine build"
}- If you don't have
srcdirectory withindex.ejsandindex.jsxentry files yet, runnode_modules/.bin/purfect-engine init - Run
npm startoryarn start - Open url on which the app is running
- Start developing
Features
| Command | Feature |
|---|---|
purfect-engine start | Start development server locally |
purfect-engine start:prod | Start development server locally with production build |
purfect-engine build | Build deployable distribution |
Development server
Purfect engine uses webpack-dev-server under the hood, it has hot reload enabled by default.
Loaders included by default
*.jsand*.jsxare loaded withbabel-loader- which can be extended via.babelrcin your root directory*.pcssfiles are loaded usingcss-loader,style-loaderand piped through preconfigured set ofpostcss-loader*.cssfiles are loaded usingcss-loaderwithout css modulesAssetsare loaded usingfile-loader
Alias
This module allows to alias all folders that are put under /src directory in a project directly, without forcing you to use relative paths. (I.e. import Button from 'components/Button' will import component from root/src/components/Button)
Production build
Generated production build includes minified and compressed version of both js and css bundles. It also adds hash to the filenames ensuring that the cache will be busted on the next release. Assets loaded with import statements will also benefit from cash-busting hashes.
Application structure
The only requirement of this package is to ensure that you use following structure:
- src
- index.ejs
- index.jsx- You must have
srcdirectory which contains your source code and specifically two entry files index.ejs- main html template which is your application entry point. It is compiled toindex.htmlduring the build stepindex.jsx- your code entry point. This file is included in yourindex.html
If you are bootstraping new project you can use purfect-engine init command to add them automatically
3 years ago
3 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago