Jai Santhosh
UI Engineer @ Flipkart
@jaisanth
@nodeday
#nodejs
Transpiling Linting CSS Preprocessors Task runners Bundling
DEVELOPMENT
Transpiling Linting CSS Preprocessors Task runners Bundling
Unit Tests Functional Tests Test reports
DEVELOPMENT
TESTING
Transpiling Linting CSS Preprocessors Task runners Bundling
Unit Tests Functional Tests Test reports
Minification Hashing filenames Deployment
Multiple ENVs
DEVELOPMENT
TESTING
DEPLOYMENT
babel
traceur
babel
traceur
jscs
eslint
jshint
babel
traceur
jscs
eslint
jshint
sass
less
cssinjs
stylus
postcss
babel
traceur
gulp
grunt
broccoli
brunch
jscs
eslint
jshint
sass
less
cssinjs
stylus
postcss
webpack
jspm
browserify
requirejs
babel
traceur
gulp
grunt
broccoli
brunch
jscs
eslint
jshint
sass
less
cssinjs
stylus
postcss
webpack
jspm
browserify
requirejs
babel
traceur
gulp
grunt
broccoli
brunch
jscs
eslint
jshint
sass
less
cssinjs
stylus
postcss
jsdom
selenium
phantomjs
mocha
chai
jest
webpack
jspm
browserify
requirejs
babel
traceur
gulp
grunt
broccoli
brunch
jscs
eslint
jshint
sass
less
cssinjs
stylus
postcss
jsdom
selenium
phantomjs
mocha
chai
jest
jenkins
express
node-haste
yeoman
webpack
jspm
browserify
requirejs
babel
traceur
gulp
grunt
broccoli
brunch
jscs
eslint
jshint
sass
less
cssinjs
stylus
postcss
jsdom
selenium
phantomjs
mocha
chai
jest
jenkins
express
node-haste
yeoman
phrontend JS
webpack
phrontend JS
phrontend JS
to
SASS & LESS are not CSS
Localize CSS for your application "components"
Composition is everything
Single responsibility modules
"Interoperable CSS" - http://glenmaddern.com/articles/interoperable-css
Module Bundler
Modules with dependencies -> Static Assets
Code splitting
Webpack loaders
Plugin system
Highly modular and configurable
Module Bundler
Module Bundler
Modules with dependencies -> Static Assets
$ webpack ./index.js bundle.js
$ webpack -w --devtool source-map
with Watch, Source Maps
Modules with dependencies -> Static Assets
You can also use a config file - webpack.config.js
{
context: __dirname + "/app",
entry: "./entry",
output: {
path: __dirname + "/dist",
filename: "bundle.js"
}
}$ webpack -w
Modules with dependencies -> Static Assets
You can also use a config file - webpack.config.js
{
entry: {
page1: "./page1",
page2: ["./entry1", "./entry2"]
},
output: {
// Make sure to use [name] or [id] in output.filename
// when using multiple entry points
filename: "[name].bundle.js",
chunkFilename: "[id].bundle.js"
}
}$ webpack -w
webpack loaders
module.loaders: [
{
// "test" is commonly used to match the file extension
test: /\.jsx$/,
// "include" is commonly used to match the directories
include: [
path.resolve(__dirname, "app/src"),
path.resolve(__dirname, "app/test")
],
// "exclude" should to used to exclude exceptions
// try to prefer "include" when possible
// the "loader"
loader: "babel-loader"
}
]webpack-dev-server
webpack-dev-middleware
module hot-loading
$ webpack-dev-server --content-base build/
$ webpack-dev-server --content-base build/ --hot
webpack plugins
More on http://webpack.github.io/
A webpack config maker
@nodeday
#nodejs
@nodeday
#nodejs