
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
advanced-boilerplate
Advanced tools
Universal React + PostCSS + CSS Modules + ESLint + Stylelint + ...
A NodeJS V6 Universal React Boilerplate with an Amazing Developer Experience.
This boilerplate contains an absolutely minimal set of dependencies in order to get you up and running with a universal react project as quickly as possible. It provides you with a great development experience that includes hot reloading of everything.
dotenv
files.fetchData
static methods where availableThis boilerplate uses Webpack 2 to produce bundles for both the client and the server code.
The reasoning for using Webpack to bundle both the client and the server is to bring greater interop and extensibility to the table. This will for instance allowing server bundles to handle React components that introduce things like CSS or Images (as and when you add the respective loaders).
Given that we are bundling our server code I have included the source-map-support
module to ensure that we get nice stack traces when executing our code via node.
All the source code is written in ES2015, and I have explicitly kept it to the true specification (bar JSX syntax). As we are following this approach it is unnecessary for us to transpile our source code for the server into ES5, as node
v6 has native support for almost all of the ES2015 syntax. Our client (browser) bundle is however transpiled to ES5 code for maximum browser/device support.
The application configuration is supported by the dotenv
module and it requires you to create a .env
file in the project root (you can use the .env.example
as a base). The .env
file has been explicitly ignored from git as it will typically contain environment sensitive/specific information. In the usual case your continuous deployment tool of choice should configure the specific .env
file that is needed for a target environment.
/
|- lib // The target output dir for our library export
| |- index.es.js // ES2015 module export
| |- index.js // CommonJS export
|
|- build // The target output dir for our build commands.
| |- client // The built client module.
| |- server // The built server module
|
|- src // All the source code
| |- common // Common utilities
| |- config // Central configuration files
| |- server // The server specific source
| |- client // The client specific source
| |- demo // Demo application
| |- webpack // Build infrastructure
| |- scripts // Available scripts when installed via npm
|
|- .babelrc // Dummy babel configuration
|- .env.example // An example from which to create your own .env file.
|- rollup.config.js // Configuration file for bundling scripts into executable
npm run start
Starts a development server for both the client and server bundles. We use react-hot-loader
v3 to power the hot reloading of the client bundle, whilst a filesystem watch is implemented to reload the server bundle when any changes have occurred.
npm run prod
Builds the client and server bundles, with the output being production optimized.
npm run prod:start
Executes the server. It expects you to have already built the bundles either via the npm run build
command or manually.
npm run clean
Deletes any build output that would have originated from the other commands.
Copyright 2016-2017
Sebastian Software GmbH
FAQs
Universal React + PostCSS + CSS Modules + ESLint + Stylelint + ...
The npm package advanced-boilerplate receives a total of 5 weekly downloads. As such, advanced-boilerplate popularity was classified as not popular.
We found that advanced-boilerplate demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.