Vintage start project (with webpack chunks auto generation).
In order to start working with project, you must:
git clone https://bitbucket.org/vintageua/vintage-start-proj.git
npm
npm i -g jscs && npm i
yarn
yarn add global jscs && yarn install
Turn off 'Safe write' option
Settings | Appearance & Behavior | System Settings | Use "safe write"
Change ECMAScript version
Settings | Languages & Frameworks | Javascript | Javascript language version: "ECMAScript6"
Enable JSCS linter
Settings | Languages & Frameworks | Javascript | Code Quality Tools | JSCS | "Enable"
Start development
npm run development
Build production bundle (build '.min' files, prettify html)
npm run production
If your project is going to be large and you want to split index.js file into separate modules, use webpack-chunks
branch of this repository:
git checkout webpack-chunks
Then add a new chunk:
require.ensure([], require => {
const loadedChunk = require('path/to/chunk');
// do stuff with loaded module
}, 'chunkFileName');
You should restart task (e.g. development
) after adding a new chunk.
Issue #26
Path: js/components/publicAPI
(example)
Public API is created for back-end developers.
It should contain methods to attach / initialize / destroy jquery plugins etc.
Install JSDoc globally
npm install jsdoc -g
Generate docs
npm run-script compileDocs
Open docs
npm run-script openDocs
- Before pushing to Bitbucket repository (or before transferring the project to Back-end department) make sure to run
production
bundle. - Ensure all of your Public API's has both
init
anddestroy
methods. - Always restart task (e.g.
development
) after adding a new chunk.