SlideShare ist ein Scribd-Unternehmen logo
1 von 84
Downloaden Sie, um offline zu lesen
Front-End build tools:
Webpack
Răzvan Roșu
/razvan-rosu
/razvan-rosu
@rzvn_rosu
What are build tools?
Definition:
Build tools are programs that automate
the process of creating applications by:
compiling, packaging code, etc
Tool of choice:
Webpack ...
Why should we use build tools?
Generic reasons:
- Accelerate the development process
- Automate repeating tasks
- Optimize the application
- Package our application for deployment
Why should we use build tools?
Front-End specific reasons:
- JavaScript hardly scales (scope, readability, size issue)
- Browsers have a bottleneck in regards to HTTP requests
(HTTP 1.1: Chrome 6, Firefox 6, Safari 6, IE 8 simultaneous persistent
connections per server/proxy)
Why Webpack?
- Other tools’ main purpose is to concatenate files.
On any change, these tools perform a full rebuild.
Concatenation causes dead code.
e.g.: pulling Lodash and momentJS into a project
- Multiple IIFEs (Immediately Invoked Function Expressions) are slow.
Bundlers early on were creating lots of IIFEs.
Task runners can’t lazy load.
Why Webpack?
and because...
What module loaders do you regularly use, if any? - JetBrains 2018 Survey
https://www.jetbrains.com/research/devecosystem-2018/javascript/
Without further ado...
http://localhost:3000
Short analysis:
index.html (static)
playground.html spa.html (SPA w/ mithrilJS)
(static)
hello.js (routed with mithrilJS)
AGENDA:
Let’s create a Webpack build
1. ES6 transpile
2. Vendor bundles + Code splitting
3. Preprocessors + Postprocessors
4. Minify JS and CSS + source maps
5. Loading assets: images + fonts
6. Development server
7. File watcher + HML*
8. Environment variables
9. Cache invalidation with hashes
10. i18n*
11. GZIP compression
12. Performance monitoring
*Framework dependent
Ready?
Preparations:
Prerequisites:
- Node ^5 (I recommend using NVM)
- NPM ^3.3.6 (I recommend Yarn)
Webpack available versions:
- 4.8.3 latest
- 3.12.0
- 2.7.0
- 1.15.0
@ 20-05-2018
Install Webpack
> touch index.html
> touch index.js
> npm init
> yarn add webpack@^1.15.0 --dev
Bundle up!
If Webpack is installed globally:
> webpack index.js ./bundle.js
If Webpack is installed locally:
> ./node_modules/.bin/webpack index.js ./bundle.js
Best practice: define a NPM script and use config file.
Configuring Webpack
> touch webpack.config.js
Basic configuration:
module.exports = {
entry: './index.js',
output: {
filename: './bundle.js'
}
};
Add NPM script in package.json
Basic script:
"scripts": {
"start": "webpack"
}
Webpack Loaders
Webpack Loaders are plugins.
There’s a loader for almost everything
Official list of loaders:
https://github.com/webpack/docs/wiki/list-of-loaders
AGENDA:
Let’s create a Webpack build
1. ES6 transpile
2. Vendor bundles + Code splitting
3. Preprocessors + Postprocessors
4. Minify JS and CSS + source maps
5. Loading assets: images + fonts
6. Development server
7. File watcher + HML*
8. Environment variables
9. Cache invalidation with hashes
10. i18n*
11. GZIP compression
12. Performance monitoring
*Framework dependent
ES6 transpile
> yarn add babel-loader@^6.4.1 babel-preset-2015 babel-core --dev
babel-loader versions:
8.0.0 beta
7.1.4 (doesn’t work with webpack 1.15.0)
6.4.1
@20-05-2018
babel-core versions:
7.0.0 beta
6.26.3
@20-05-2018
ES6 transpile
Extend webpack.config.js for: transpiling ES6 and separate build from development files.
const path = require('path');
module.exports = {
entry: './index.js',
output: {
path: path.join(__dirname, 'build'),
filename: 'index.bundle.js'
},
module: {
loaders: [
{
test: /.js$/,
loader: 'babel',
exclude: /node_modules/,
query: {
presets: ['es2015']
}
}
]}};
ES6 transpile
Notes:
● Until Babel 5, all transformations were automatically transpiled.
Starting with Babel 6, everything is opt-in.
● Available transforms: react, es2015, ecmascript stages.
Add these in .babelrc if needed.
> touch .babelrc
{
"presets": ["es2015", "stage-1"]
}
AGENDA:
Let’s create a Webpack build
1. ES6 transpile
2. Vendor bundles + Code splitting
3. Preprocessors + Postprocessors
4. Minify JS and CSS + source maps
5. Loading assets: images + fonts
6. Development server
7. File watcher + HML*
8. Environment variables
9. Cache invalidation with hashes
10. i18n*
11. GZIP compression
12. Performance monitoring
*Framework dependent
AGENDA:
Let’s create a Webpack build
1. ES6 transpile
2. Vendor bundles + Code splitting
3. Preprocessors + Postprocessors
4. Minify JS and CSS + source maps
5. Loading assets: images + fonts
6. Development server
7. File watcher + HML*
8. Environment variables
9. Cache invalidation with hashes
10. i18n*
11. GZIP compression
12. Performance monitoring
*Framework dependent
Preprocessors and Postprocessors
> yarn add style-loader css-loader --dev
> yarn add sass-loader node-sass autoprefixer-loader --dev
> yarn add extract-text-webpack-plugin@^1.0.1 --dev
Available version:
style-loader 0.21.0
css-loader 0.28.11
node-sass 4.9.0
sass-loader 7.0.1
@28-05-2018
Available version:
autoprefixer-loader 3.2.0
extract-text-webpack-plugin
3.0.2 latest
1.0.1 (webpack ^1.*)
Preprocessors and Postprocessors
We preprocess SCSS into CSS w/ sass-loader, node-sass.
We load CSS into the document’s head w/ style-loader, css-loader.
We postprocess the properties with desired vendor prefixes w/ autoprefixer-loader
We import the output styles into the file via a link tag instead of inlining w/
extract-text-webpack-plugin.
Preprocessors and Postprocessors
Let’s add some SCSS files…
> touch src/master.scss styles/_colors.scss styles/_typography.scss
Preprocessors and Postprocessors
Let’s configure the loaders
const ExtractTextPlugin =
require("extract-text-webpack-plugin");
module.exports = {
entry: {
app: ['./src/index.js','./src/master.scss']
},
output: {
path: path.join(__dirname, 'build'),
filename: '[name].bundle.js'
},
module.exports = {
...
module: {
loaders: [
{
test: /.scss$/,
loader: ExtractTextPlugin.extract('style',
'css-loader!autoprefixer?browsers=last 2
versions!sass')
}
]
},
plugins: [new ExtractTextPlugin("[name].bundle.css")]
AGENDA:
Let’s create a Webpack build
1. ES6 transpile
2. Vendor bundles + Code splitting
3. Preprocessors + Postprocessors
4. Minify JS and CSS + source maps
5. Loading assets: images + fonts
6. Development server
7. File watcher + HML*
8. Environment variables
9. Cache invalidation with hashes
10. i18n*
11. GZIP compression
12. Performance monitoring
*Framework dependent
AGENDA:
Let’s create a Webpack build
1. ES6 transpile
2. Vendor bundles + Code splitting
3. Preprocessors + Postprocessors
4. Minify JS and CSS + source maps
5. Loading assets: images + fonts
6. Development server
7. File watcher + HML*
8. Environment variables
9. Cache invalidation with hashes
10. i18n*
11. GZIP compression
12. Performance monitoring
*Framework dependent
Development server
> yarn add webpack-dev-server@^1.16.5 --dev
Available versions:
3.1.5 latest
1.16.5 (webpack ^1.*)
@28-05-2018
Development server
Configuring the plugin
webpack.config.js
module.exports = {
...
devServer: {
inline: true,
port: 1337
},
…
};
Change NPM scripts
package.json
"scripts": {
"start": "webpack-dev-server",
"build:prod": "webpack",
"clean": "rm -rf build"
},
AGENDA:
Let’s create a Webpack build
1. ES6 transpile
2. Vendor bundles + Code splitting
3. Preprocessors + Postprocessors
4. Minify JS and CSS + source maps
5. Loading assets: images + fonts
6. Development server
7. File watcher + HML*
8. Environment variables
9. Cache invalidation with hashes
10. i18n*
11. GZIP compression
12. Performance monitoring
*Framework dependent
AGENDA:
Let’s create a Webpack build
1. ES6 transpile
2. Vendor bundles + Code splitting
3. Preprocessors + Postprocessors
4. Minify JS and CSS + source maps
5. Loading assets: images + fonts
6. Development server
7. File watcher + HML*
8. Environment variables
9. Cache invalidation with hashes
10. i18n*
11. GZIP compression
12. Performance monitoring
*Framework dependent
File watcher + Hot Module Replacement*
File watching is a built-in feature of Webpack.
In order to enable it, we add a --watch.
package.json
"scripts": {
"start": "webpack-dev-server",
"build:dev": "webpack --watch",
"build:prod": "webpack",
"clean": "rm -rf build"
},
Thus:
> npm run build:dev
> npm start
Note! Don’t forget to:
- require the master.scss file in index.js
for parsing
- include the bundles in your index.html
file
File watcher + Hot Module Replacement*
HMR (Hot Module replacement) allows webpack to reload only chunks of JS code, instead of
the whole code base.
It can be used with Redux or specific framework loaders for HML.
e.g.: react-hot-loader, vue-hot-loader
AGENDA:
Let’s create a Webpack build
1. ES6 transpile
2. Vendor bundles + Code splitting
3. Preprocessors + Postprocessors
4. Minify JS and CSS + source maps
5. Loading assets: images + fonts
6. Development server
7. File watcher + HML*
8. Environment variables
9. Cache invalidation with hashes
10. i18n*
11. GZIP compression
12. Performance monitoring
*Framework dependent
AGENDA:
Let’s create a Webpack build
1. ES6 transpile
2. Vendor bundles + Code splitting
3. Preprocessors + Postprocessors
4. Minify JS and CSS + source maps
5. Loading assets: images + fonts
6. Development server
7. File watcher + HML*
8. Environment variables
9. Cache invalidation with hashes
10. i18n*
11. GZIP compression
12. Performance monitoring
*Framework dependent
Loading assets: images and fonts
Q: Why use a Loader for images?
A: Performance
Q: How is it better performing?
A: The images are encrypted into base64 and injected into the DOM tree.
In other words less HTTP requests.
Q: Is there a downside?
A: Yes, the image source is assigned via JS. You will manage the images from outside HTML
and crawlers will not be able to reach it without prerendering.
Loading assets: images and fonts
> yarn add url-loader file-loader --dev
Available versions:
url-loader 1.0.1
file-loader 1.1.11
@28-05-2018
Loading assets: images and fonts
{
test: /.(png|jp(e*)g|svg)$/,
loader: 'url-loader?limit=900000'
},
{
test: /.woff2?(?v=d+.d+.d+)?$/,
loader: 'url-loader',
use: {
options: {
mimetype: 'application/font-woff',
name: "./src/fonts/[name].[ext]"
}
}
}
Loading assets: images and fonts
index.html
<img id="manticore-img" alt="Manticore" title="Manticore">
index.js
import manticoreimg from './images/manticore.png';
const manticore = document.getElementById('manticore-img');
if (manticore) manticore.src = manticoreimg;
import pattern from './images/pattern.png';
master.scss
footer {
background: $color-main url('images/pattern.png') left top repeat-x;
}
Loading assets: images and fonts
typography.scss
@font-face {
font-family: 'Nunito';
...}
@font-face {
font-family: 'Space Mono';
...}
$font-main: 'Space Mono', monospace;
$font-secondary: 'Nunito', sans-serif;
AGENDA:
Let’s create a Webpack build
1. ES6 transpile
2. Vendor bundles + Code splitting
3. Preprocessors + Postprocessors
4. Minify JS and CSS + source maps
5. Loading assets: images + fonts
6. Development server
7. File watcher + HML*
8. Environment variables
9. Cache invalidation with hashes
10. i18n*
11. GZIP compression
12. Performance monitoring
*Framework dependent
AGENDA:
Let’s create a Webpack build
1. ES6 transpile
2. Vendor bundles + Code splitting
3. Preprocessors + Postprocessors
4. Minify JS and CSS + source maps
5. Loading assets: images + fonts
6. Development server
7. File watcher + HML*
8. Environment variables
9. Cache invalidation with hashes
10. i18n*
11. GZIP compression
12. Performance monitoring
*Framework dependent
commons.bundle.js
OR
vendors.bundle.js
Vendor bundles and Code splitting
Q: What is Code Splitting?
A: Multiple bundle files setup
page1.js
page2.js
page3.js
page1.bundle.js
page2.bundle.js
page3.bundle.js
Vendor bundles and Code splitting
We will use CommonsChunks, a preinstalled Webpack plugin.
Possible configurations:
- Detect repeating dependencies in all entries and split into commons.bundle.js + unique
bundles
- Manually define dependencies for a vendor.bundle.js which should be included on
every page.
Vendor bundles and Code splitting
webpack.config.js
const webpack = require('webpack');
const CommonsChunkPlugin = require('./node_modules/webpack/lib/optimize/CommonsChunkPlugin');
module.exports = {
entry: {
app: [
'./src/index.js',
'./src/master.scss'
],
page1: './src/scripts/page1.js',
page2: './src/scripts/page2.js',
vendor: ['angular']
},
...
module.exports = {
...
plugins: {
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
filename: 'vendor.bundle.js',
minChunks: Infinity
}),
}
AGENDA:
Let’s create a Webpack build
1. ES6 transpile
2. Vendor bundles + Code splitting
3. Preprocessors + Postprocessors
4. Minify JS and CSS + source maps
5. Loading assets: images + fonts
6. Development server
7. File watcher + HML*
8. Environment variables
9. Cache invalidation with hashes
10. i18n*
11. GZIP compression
12. Performance monitoring
*Framework dependent
AGENDA:
Let’s create a Webpack build
1. ES6 transpile
2. Vendor bundles + Code splitting
3. Preprocessors + Postprocessors
4. Minify JS and CSS + source maps
5. Loading assets: images + fonts
6. Development server
7. File watcher + HML*
8. Environment variables
9. Cache invalidation with hashes
10. i18n*
11. GZIP compression
12. Performance monitoring
*Framework dependent
Minify JS and CSS + source maps
Source maps are a built-in feature.
Source maps establish the connection between bundles
and the original files.
They have a performance drawback. It is best practice to disable them in
production.
webpack.config.js
module.exports = {
...
devtool: 'source-map',
...
}
Minify JS and CSS + source maps
In order to map bundled CSS with SCSS, we need to modify it’s loader
params
module: {
loaders: [
{loader: ExtractTextPlugin.extract('style',
'css-loader?sourceMap!autoprefixer?browsers=last 2 versions!sass)}
]}
Minify JS and CSS + source maps
We can minify (uglify) bundles with another built-in plugin: UglifyJsPlugin.
const UglifyJsPlugin = require('./node_modules/webpack/lib/optimize/UglifyJsPlugin');
module.exports = {
...
plugins: [
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false,
drop_console: false
}
})
]
}
AGENDA:
Let’s create a Webpack build
1. ES6 transpile
2. Vendor bundles + Code splitting
3. Preprocessors + Postprocessors
4. Minify JS and CSS + source maps
5. Loading assets: images + fonts
6. Development server
7. File watcher + HML*
8. Environment variables
9. Cache invalidation with hashes
10. i18n*
11. GZIP compression
12. Performance monitoring
*Framework dependent
AGENDA:
Let’s create a Webpack build
1. ES6 transpile
2. Vendor bundles + Code splitting
3. Preprocessors + Postprocessors
4. Minify JS and CSS + source maps
5. Loading assets: images + fonts
6. Development server
7. File watcher + HML*
8. Environment variables
9. Cache invalidation with hashes
10. i18n*
11. GZIP compression
12. Performance monitoring
*Framework dependent
ENV variables
Environment variables are not a Webpack feature.
We can send value through NPM scripts.
"scripts": {
"start": "NODE_ENV=production webpack-dev-server",
"build:dev": "NODE_ENV=development webpack-dev-server --watch",
"build:prod": "NODE_ENV=production webpack",
"build:debugprod": "NODE_ENV=debugproduction webpack-dev-server --watch",
"clean": "rm -rf build"
},
ENV variables
We can catch inside webpack.config.js the values send through NPM
scripts as follows:
/**
* ENV variables
*/
const env = process.env.NODE_ENV;
const isDev = env === 'development';
const isProd = env === 'production';
const debugProd = env === 'debugproduction';
ENV variables
Based on our needs, we define specific behaviour for
production and development.
e.g.:
devtool: isProd ? false : 'source-map',
(isDev || debugProd) ? module.exports.plugins.push(new BundleAnalyzerPlugin()) : '';
AGENDA:
Let’s create a Webpack build
1. ES6 transpile
2. Vendor bundles + Code splitting
3. Preprocessors + Postprocessors
4. Minify JS and CSS + source maps
5. Loading assets: images + fonts
6. Development server
7. File watcher + HML*
8. Environment variables
9. Cache invalidation with hashes
10. i18n*
11. GZIP compression
12. Performance monitoring
*Framework dependent
AGENDA:
Let’s create a Webpack build
1. ES6 transpile
2. Vendor bundles + Code splitting
3. Preprocessors + Postprocessors
4. Minify JS and CSS + source maps
5. Loading assets: images + fonts
6. Development server
7. File watcher + HML*
8. Environment variables
9. Cache invalidation with hashes
10. i18n*
11. GZIP compression
12. Performance monitoring
*Framework dependent
Cache invalidation with hashes
Webpack offers several placeholders.
We’ve used [name] before for passing the same filename from dev files
to bundles. We can also use [chunkhash] and [contenthash] to add a
hash within the filenames.
Cache invalidation with hashes
We will update our build filenames as follows:
module.exports = {
...
output: {
path: path.join(__dirname, 'build'),
filename: '[name].bundle.[chunkhash:4].js'
},
…
plugins: [
new ExtractTextPlugin('[name].min.[contenthash:4].css'),
…
]
Cache invalidation with hashes
Webpack can inject the bundle names (with autogenerated hashes)
dynamically with a loader.
> yarn add html-webpack-plugin --dev
Cache invalidation with hashes
Configure html-webpack-plugin:
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
...
plugins: [
...
new HtmlWebpackPlugin({
template: path.join(__dirname, 'index.html'),
filename: 'index.html',
chunks: ['vendor', 'app']
}),
...
]
Cache invalidation with hashes
Note:
Remove from index.html the CSS link and bundle scripts!
A new index.html file will be created within build,
with the hashed bundles injected and served in the browser.
Cache invalidation with hashes
AGENDA:
Let’s create a Webpack build
1. ES6 transpile
2. Vendor bundles + Code splitting
3. Preprocessors + Postprocessors
4. Minify JS and CSS + source maps
5. Loading assets: images + fonts
6. Development server
7. File watcher + HML*
8. Environment variables
9. Cache invalidation with hashes
10. i18n*
11. GZIP compression
12. Performance monitoring
*Framework dependent
AGENDA:
Let’s create a Webpack build
1. ES6 transpile
2. Vendor bundles + Code splitting
3. Preprocessors + Postprocessors
4. Minify JS and CSS + source maps
5. Loading assets: images + fonts
6. Development server
7. File watcher + HML*
8. Environment variables
9. Cache invalidation with hashes
10. i18n*
11. GZIP compression
12. Performance monitoring
*Framework dependent
Internationlization i18n*
There are all sorts of i18n loaders based on the framework that you will
use in your project.
i18n-express
react-i18next
@ngx-translate/core
AGENDA:
Let’s create a Webpack build
1. ES6 transpile
2. Vendor bundles + Code splitting
3. Preprocessors + Postprocessors
4. Minify JS and CSS + source maps
5. Loading assets: images + fonts
6. Development server
7. File watcher + HML*
8. Environment variables
9. Cache invalidation with hashes
10. i18n*
11. GZIP compression
12. Performance monitoring
*Framework dependent
AGENDA:
Let’s create a Webpack build
1. ES6 transpile
2. Vendor bundles + Code splitting
3. Preprocessors + Postprocessors
4. Minify JS and CSS + source maps
5. Loading assets: images + fonts
6. Development server
7. File watcher + HML*
8. Environment variables
9. Cache invalidation with hashes
10. i18n*
11. GZIP compression
12. Performance monitoring
*Framework dependent
GZip compression
We can compile our assets into binary files
e.g.: vendor.bundle.js -> vendor.bundle.js.gz
> yarn add compression-webpack-plugin --dev
GZip compression
webpack.config.js
const CompressionPlugin = require("compression-webpack-plugin");
module.exports = {
...
new CompressionPlugin({
asset : "[path].gz[query]",
algorithm : "gzip",
test : /.js$|.css$|.html$/,
threshold : 10240,
minRatio : 0.8
})
}
GZip compression
Note:
Serving gzip files can be done through NGINX.
Binary files aren’t supported by all browsers.
NGINX can provide the normal file as fallback.
AGENDA:
Let’s create a Webpack build
1. ES6 transpile
2. Vendor bundles + Code splitting
3. Preprocessors + Postprocessors
4. Minify JS and CSS + source maps
5. Loading assets: images + fonts
6. Development server
7. File watcher + HML*
8. Environment variables
9. Cache invalidation with hashes
10. i18n*
11. GZIP compression
12. Performance monitoring
*Framework dependent
AGENDA:
Let’s create a Webpack build
1. ES6 transpile
2. Vendor bundles + Code splitting
3. Preprocessors + Postprocessors
4. Minify JS and CSS + source maps
5. Loading assets: images + fonts
6. Development server
7. File watcher + HML*
8. Environment variables
9. Cache invalidation with hashes
10. i18n*
11. GZIP compression
12. Performance monitoring
*Framework dependent
Performance monitoring
We can have a visual preview of our bundles with the help of
webpack-bundle-analyzer plugin.
Performance monitoring
> yarn add webpack-bundle-analyzer --dev
webpack.config.js
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
module.exports = {
plugins: [
...
new BundleAnalyzerPlugin())
]
};
AGENDA:
Let’s create a Webpack build
1. ES6 transpile
2. Vendor bundles + Code splitting
3. Preprocessors + Postprocessors
4. Minify JS and CSS + source maps
5. Loading assets: images + fonts
6. Development server
7. File watcher + HML*
8. Environment variables
9. Cache invalidation with hashes
10. i18n*
11. GZIP compression
12. Performance monitoring
*Framework dependent
Everything clear? kkthxbye
Thank you!
Questions
?
REFERENCES:
Official documentation:
https://webpack.js.org/
Online courses (Free & Paid):
https://webpack.academy
Good stuff:
https://survivejs.com/webpack/fore
word/
REFERENCES:
Advanced example:
https://github.com/razvan-rosu/web
pack1-boilerplate
Presentation example:
https://github.com/razvan-rosu/de
mo-webpack-presentation

Weitere ähnliche Inhalte

Was ist angesagt?

Webpack
Webpack Webpack
Webpack DataArt
 
Module design pattern i.e. express js
Module design pattern i.e. express jsModule design pattern i.e. express js
Module design pattern i.e. express jsAhmed Assaf
 
Packing it all: JavaScript module bundling from 2000 to now
Packing it all: JavaScript module bundling from 2000 to nowPacking it all: JavaScript module bundling from 2000 to now
Packing it all: JavaScript module bundling from 2000 to nowDerek Willian Stavis
 
Let's run JavaScript Everywhere
Let's run JavaScript EverywhereLet's run JavaScript Everywhere
Let's run JavaScript EverywhereTom Croucher
 
Bundling your front-end with Webpack
Bundling your front-end with WebpackBundling your front-end with Webpack
Bundling your front-end with WebpackDanillo Corvalan
 
(2018) Webpack Encore - Asset Management for the rest of us
(2018) Webpack Encore - Asset Management for the rest of us(2018) Webpack Encore - Asset Management for the rest of us
(2018) Webpack Encore - Asset Management for the rest of usStefan Adolf
 
Build Your Own CMS with Apache Sling
Build Your Own CMS with Apache SlingBuild Your Own CMS with Apache Sling
Build Your Own CMS with Apache SlingBob Paulin
 
Vue 淺談前端建置工具
Vue 淺談前端建置工具Vue 淺談前端建置工具
Vue 淺談前端建置工具andyyou
 
Node JS Express: Steps to Create Restful Web App
Node JS Express: Steps to Create Restful Web AppNode JS Express: Steps to Create Restful Web App
Node JS Express: Steps to Create Restful Web AppEdureka!
 
Webpack Encore - Asset Management for the rest of us
Webpack Encore - Asset Management for the rest of usWebpack Encore - Asset Management for the rest of us
Webpack Encore - Asset Management for the rest of usStefan Adolf
 
OpenCms Days 2015 Creating Apps for the OpenCms 10 workplace
OpenCms Days 2015  Creating Apps for the OpenCms 10 workplace OpenCms Days 2015  Creating Apps for the OpenCms 10 workplace
OpenCms Days 2015 Creating Apps for the OpenCms 10 workplace Alkacon Software GmbH & Co. KG
 
OSGi, Scripting and REST, Building Webapps With Apache Sling
OSGi, Scripting and REST, Building Webapps With Apache SlingOSGi, Scripting and REST, Building Webapps With Apache Sling
OSGi, Scripting and REST, Building Webapps With Apache SlingCarsten Ziegeler
 
OpenCms Days 2014 - Enhancing OpenCms front end development with Sass and Grunt
OpenCms Days 2014 - Enhancing OpenCms front end development with Sass and GruntOpenCms Days 2014 - Enhancing OpenCms front end development with Sass and Grunt
OpenCms Days 2014 - Enhancing OpenCms front end development with Sass and GruntAlkacon Software GmbH & Co. KG
 
RESTful web apps with Apache Sling - 2013 version
RESTful web apps with Apache Sling - 2013 versionRESTful web apps with Apache Sling - 2013 version
RESTful web apps with Apache Sling - 2013 versionBertrand Delacretaz
 

Was ist angesagt? (20)

Webpack
Webpack Webpack
Webpack
 
Webpack slides
Webpack slidesWebpack slides
Webpack slides
 
Module design pattern i.e. express js
Module design pattern i.e. express jsModule design pattern i.e. express js
Module design pattern i.e. express js
 
Packing it all: JavaScript module bundling from 2000 to now
Packing it all: JavaScript module bundling from 2000 to nowPacking it all: JavaScript module bundling from 2000 to now
Packing it all: JavaScript module bundling from 2000 to now
 
Let's run JavaScript Everywhere
Let's run JavaScript EverywhereLet's run JavaScript Everywhere
Let's run JavaScript Everywhere
 
Bundling your front-end with Webpack
Bundling your front-end with WebpackBundling your front-end with Webpack
Bundling your front-end with Webpack
 
OpenCms Days 2015 Workflow using Docker and Jenkins
OpenCms Days 2015 Workflow using Docker and JenkinsOpenCms Days 2015 Workflow using Docker and Jenkins
OpenCms Days 2015 Workflow using Docker and Jenkins
 
(2018) Webpack Encore - Asset Management for the rest of us
(2018) Webpack Encore - Asset Management for the rest of us(2018) Webpack Encore - Asset Management for the rest of us
(2018) Webpack Encore - Asset Management for the rest of us
 
Build Your Own CMS with Apache Sling
Build Your Own CMS with Apache SlingBuild Your Own CMS with Apache Sling
Build Your Own CMS with Apache Sling
 
OpenCms Days 2013 - Site Management Tool
OpenCms Days 2013 - Site Management ToolOpenCms Days 2013 - Site Management Tool
OpenCms Days 2013 - Site Management Tool
 
Vue 淺談前端建置工具
Vue 淺談前端建置工具Vue 淺談前端建置工具
Vue 淺談前端建置工具
 
Sails.js Intro
Sails.js IntroSails.js Intro
Sails.js Intro
 
Node JS Express: Steps to Create Restful Web App
Node JS Express: Steps to Create Restful Web AppNode JS Express: Steps to Create Restful Web App
Node JS Express: Steps to Create Restful Web App
 
Webpack Encore - Asset Management for the rest of us
Webpack Encore - Asset Management for the rest of usWebpack Encore - Asset Management for the rest of us
Webpack Encore - Asset Management for the rest of us
 
OpenCms Days 2015 Creating Apps for the OpenCms 10 workplace
OpenCms Days 2015  Creating Apps for the OpenCms 10 workplace OpenCms Days 2015  Creating Apps for the OpenCms 10 workplace
OpenCms Days 2015 Creating Apps for the OpenCms 10 workplace
 
Angular2 ecosystem
Angular2 ecosystemAngular2 ecosystem
Angular2 ecosystem
 
OSGi, Scripting and REST, Building Webapps With Apache Sling
OSGi, Scripting and REST, Building Webapps With Apache SlingOSGi, Scripting and REST, Building Webapps With Apache Sling
OSGi, Scripting and REST, Building Webapps With Apache Sling
 
OpenCms Days 2014 - Enhancing OpenCms front end development with Sass and Grunt
OpenCms Days 2014 - Enhancing OpenCms front end development with Sass and GruntOpenCms Days 2014 - Enhancing OpenCms front end development with Sass and Grunt
OpenCms Days 2014 - Enhancing OpenCms front end development with Sass and Grunt
 
OpenCms Days 2015 Hidden features of OpenCms
OpenCms Days 2015 Hidden features of OpenCmsOpenCms Days 2015 Hidden features of OpenCms
OpenCms Days 2015 Hidden features of OpenCms
 
RESTful web apps with Apache Sling - 2013 version
RESTful web apps with Apache Sling - 2013 versionRESTful web apps with Apache Sling - 2013 version
RESTful web apps with Apache Sling - 2013 version
 

Ähnlich wie Front-end build tools - Webpack

Introduction of webpack 4
Introduction of webpack 4Introduction of webpack 4
Introduction of webpack 4Vijay Shukla
 
Introduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azureIntroduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azureColin Mackay
 
[Patel] SPFx: An ISV Insight into latest Microsoft's customization model
[Patel] SPFx: An ISV Insight into latest Microsoft's customization model[Patel] SPFx: An ISV Insight into latest Microsoft's customization model
[Patel] SPFx: An ISV Insight into latest Microsoft's customization modelEuropean Collaboration Summit
 
Building an Ionic hybrid mobile app with TypeScript
Building an Ionic hybrid mobile app with TypeScript Building an Ionic hybrid mobile app with TypeScript
Building an Ionic hybrid mobile app with TypeScript Serge van den Oever
 
Deploying windows containers with kubernetes
Deploying windows containers with kubernetesDeploying windows containers with kubernetes
Deploying windows containers with kubernetesBen Hall
 
I Just Want to Run My Code: Waypoint, Nomad, and Other Things
I Just Want to Run My Code: Waypoint, Nomad, and Other ThingsI Just Want to Run My Code: Waypoint, Nomad, and Other Things
I Just Want to Run My Code: Waypoint, Nomad, and Other ThingsMichael Lange
 
The next step from Microsoft - Vnext (Srdjan Poznic)
The next step from Microsoft - Vnext (Srdjan Poznic)The next step from Microsoft - Vnext (Srdjan Poznic)
The next step from Microsoft - Vnext (Srdjan Poznic)Geekstone
 
webpack introductionNotice Demystifyingf
webpack introductionNotice Demystifyingfwebpack introductionNotice Demystifyingf
webpack introductionNotice DemystifyingfMrVMNair
 
Ruby on Rails Kickstart 101 & 102
Ruby on Rails Kickstart 101 & 102Ruby on Rails Kickstart 101 & 102
Ruby on Rails Kickstart 101 & 102Heng-Yi Wu
 
Phonegap android angualr material design
Phonegap android angualr material designPhonegap android angualr material design
Phonegap android angualr material designSrinadh Kanugala
 
Getting rid of pain with Heroku @ BrainDev Kyiv
Getting rid of pain with Heroku @ BrainDev KyivGetting rid of pain with Heroku @ BrainDev Kyiv
Getting rid of pain with Heroku @ BrainDev KyivSeniorDevOnly
 
GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins
GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins
GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins Mando Stam
 
Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)
Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)
Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)Chris O'Brien
 

Ähnlich wie Front-end build tools - Webpack (20)

Introduction of webpack 4
Introduction of webpack 4Introduction of webpack 4
Introduction of webpack 4
 
Introduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azureIntroduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azure
 
[Patel] SPFx: An ISV Insight into latest Microsoft's customization model
[Patel] SPFx: An ISV Insight into latest Microsoft's customization model[Patel] SPFx: An ISV Insight into latest Microsoft's customization model
[Patel] SPFx: An ISV Insight into latest Microsoft's customization model
 
Webpack
WebpackWebpack
Webpack
 
CDNs para el SharePoint Framework (SPFx)
CDNs para el SharePoint Framework (SPFx)CDNs para el SharePoint Framework (SPFx)
CDNs para el SharePoint Framework (SPFx)
 
Building an Ionic hybrid mobile app with TypeScript
Building an Ionic hybrid mobile app with TypeScript Building an Ionic hybrid mobile app with TypeScript
Building an Ionic hybrid mobile app with TypeScript
 
Deploying windows containers with kubernetes
Deploying windows containers with kubernetesDeploying windows containers with kubernetes
Deploying windows containers with kubernetes
 
I Just Want to Run My Code: Waypoint, Nomad, and Other Things
I Just Want to Run My Code: Waypoint, Nomad, and Other ThingsI Just Want to Run My Code: Waypoint, Nomad, and Other Things
I Just Want to Run My Code: Waypoint, Nomad, and Other Things
 
An Intro into webpack
An Intro into webpackAn Intro into webpack
An Intro into webpack
 
The next step from Microsoft - Vnext (Srdjan Poznic)
The next step from Microsoft - Vnext (Srdjan Poznic)The next step from Microsoft - Vnext (Srdjan Poznic)
The next step from Microsoft - Vnext (Srdjan Poznic)
 
Docker
DockerDocker
Docker
 
webpack introductionNotice Demystifyingf
webpack introductionNotice Demystifyingfwebpack introductionNotice Demystifyingf
webpack introductionNotice Demystifyingf
 
Ruby on Rails Kickstart 101 & 102
Ruby on Rails Kickstart 101 & 102Ruby on Rails Kickstart 101 & 102
Ruby on Rails Kickstart 101 & 102
 
ASP.NET vNext
ASP.NET vNextASP.NET vNext
ASP.NET vNext
 
Phonegap android angualr material design
Phonegap android angualr material designPhonegap android angualr material design
Phonegap android angualr material design
 
Short-Training asp.net vNext
Short-Training asp.net vNextShort-Training asp.net vNext
Short-Training asp.net vNext
 
Getting rid of pain with Heroku @ BrainDev Kyiv
Getting rid of pain with Heroku @ BrainDev KyivGetting rid of pain with Heroku @ BrainDev Kyiv
Getting rid of pain with Heroku @ BrainDev Kyiv
 
Building JavaScript
Building JavaScriptBuilding JavaScript
Building JavaScript
 
GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins
GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins
GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins
 
Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)
Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)
Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)
 

Mehr von Razvan Rosu

Design systems - Razvan Rosu
Design systems - Razvan RosuDesign systems - Razvan Rosu
Design systems - Razvan RosuRazvan Rosu
 
Progressive Web Apps with LitHTML (BucharestJS Meetup)
Progressive Web Apps with LitHTML (BucharestJS Meetup)Progressive Web Apps with LitHTML (BucharestJS Meetup)
Progressive Web Apps with LitHTML (BucharestJS Meetup)Razvan Rosu
 
Web Accessibility - Razvan Rosu
Web Accessibility - Razvan RosuWeb Accessibility - Razvan Rosu
Web Accessibility - Razvan RosuRazvan Rosu
 
Thinking in components
Thinking in componentsThinking in components
Thinking in componentsRazvan Rosu
 
Web optimizations Back to the basics - Razvan Rosu
Web optimizations  Back to the basics - Razvan RosuWeb optimizations  Back to the basics - Razvan Rosu
Web optimizations Back to the basics - Razvan RosuRazvan Rosu
 
CSS Grid Layout - Razvan Rosu
CSS Grid Layout - Razvan RosuCSS Grid Layout - Razvan Rosu
CSS Grid Layout - Razvan RosuRazvan Rosu
 
Atomic design - Razvan Rosu
Atomic design - Razvan RosuAtomic design - Razvan Rosu
Atomic design - Razvan RosuRazvan Rosu
 

Mehr von Razvan Rosu (7)

Design systems - Razvan Rosu
Design systems - Razvan RosuDesign systems - Razvan Rosu
Design systems - Razvan Rosu
 
Progressive Web Apps with LitHTML (BucharestJS Meetup)
Progressive Web Apps with LitHTML (BucharestJS Meetup)Progressive Web Apps with LitHTML (BucharestJS Meetup)
Progressive Web Apps with LitHTML (BucharestJS Meetup)
 
Web Accessibility - Razvan Rosu
Web Accessibility - Razvan RosuWeb Accessibility - Razvan Rosu
Web Accessibility - Razvan Rosu
 
Thinking in components
Thinking in componentsThinking in components
Thinking in components
 
Web optimizations Back to the basics - Razvan Rosu
Web optimizations  Back to the basics - Razvan RosuWeb optimizations  Back to the basics - Razvan Rosu
Web optimizations Back to the basics - Razvan Rosu
 
CSS Grid Layout - Razvan Rosu
CSS Grid Layout - Razvan RosuCSS Grid Layout - Razvan Rosu
CSS Grid Layout - Razvan Rosu
 
Atomic design - Razvan Rosu
Atomic design - Razvan RosuAtomic design - Razvan Rosu
Atomic design - Razvan Rosu
 

Kürzlich hochgeladen

call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Bert Jan Schrijver
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024VictoriaMetrics
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...masabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Hararemasabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2
 

Kürzlich hochgeladen (20)

call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 

Front-end build tools - Webpack

  • 1. Front-End build tools: Webpack Răzvan Roșu /razvan-rosu /razvan-rosu @rzvn_rosu
  • 2. What are build tools? Definition: Build tools are programs that automate the process of creating applications by: compiling, packaging code, etc
  • 4. Why should we use build tools? Generic reasons: - Accelerate the development process - Automate repeating tasks - Optimize the application - Package our application for deployment
  • 5. Why should we use build tools? Front-End specific reasons: - JavaScript hardly scales (scope, readability, size issue) - Browsers have a bottleneck in regards to HTTP requests (HTTP 1.1: Chrome 6, Firefox 6, Safari 6, IE 8 simultaneous persistent connections per server/proxy)
  • 6. Why Webpack? - Other tools’ main purpose is to concatenate files. On any change, these tools perform a full rebuild. Concatenation causes dead code. e.g.: pulling Lodash and momentJS into a project - Multiple IIFEs (Immediately Invoked Function Expressions) are slow. Bundlers early on were creating lots of IIFEs. Task runners can’t lazy load.
  • 7. Why Webpack? and because... What module loaders do you regularly use, if any? - JetBrains 2018 Survey https://www.jetbrains.com/research/devecosystem-2018/javascript/
  • 9. Short analysis: index.html (static) playground.html spa.html (SPA w/ mithrilJS) (static) hello.js (routed with mithrilJS)
  • 10. AGENDA: Let’s create a Webpack build 1. ES6 transpile 2. Vendor bundles + Code splitting 3. Preprocessors + Postprocessors 4. Minify JS and CSS + source maps 5. Loading assets: images + fonts 6. Development server 7. File watcher + HML* 8. Environment variables 9. Cache invalidation with hashes 10. i18n* 11. GZIP compression 12. Performance monitoring *Framework dependent
  • 12. Preparations: Prerequisites: - Node ^5 (I recommend using NVM) - NPM ^3.3.6 (I recommend Yarn) Webpack available versions: - 4.8.3 latest - 3.12.0 - 2.7.0 - 1.15.0 @ 20-05-2018
  • 13. Install Webpack > touch index.html > touch index.js > npm init > yarn add webpack@^1.15.0 --dev
  • 14. Bundle up! If Webpack is installed globally: > webpack index.js ./bundle.js If Webpack is installed locally: > ./node_modules/.bin/webpack index.js ./bundle.js Best practice: define a NPM script and use config file.
  • 15. Configuring Webpack > touch webpack.config.js Basic configuration: module.exports = { entry: './index.js', output: { filename: './bundle.js' } }; Add NPM script in package.json Basic script: "scripts": { "start": "webpack" }
  • 16. Webpack Loaders Webpack Loaders are plugins. There’s a loader for almost everything Official list of loaders: https://github.com/webpack/docs/wiki/list-of-loaders
  • 17. AGENDA: Let’s create a Webpack build 1. ES6 transpile 2. Vendor bundles + Code splitting 3. Preprocessors + Postprocessors 4. Minify JS and CSS + source maps 5. Loading assets: images + fonts 6. Development server 7. File watcher + HML* 8. Environment variables 9. Cache invalidation with hashes 10. i18n* 11. GZIP compression 12. Performance monitoring *Framework dependent
  • 18. ES6 transpile > yarn add babel-loader@^6.4.1 babel-preset-2015 babel-core --dev babel-loader versions: 8.0.0 beta 7.1.4 (doesn’t work with webpack 1.15.0) 6.4.1 @20-05-2018 babel-core versions: 7.0.0 beta 6.26.3 @20-05-2018
  • 19. ES6 transpile Extend webpack.config.js for: transpiling ES6 and separate build from development files. const path = require('path'); module.exports = { entry: './index.js', output: { path: path.join(__dirname, 'build'), filename: 'index.bundle.js' }, module: { loaders: [ { test: /.js$/, loader: 'babel', exclude: /node_modules/, query: { presets: ['es2015'] } } ]}};
  • 20. ES6 transpile Notes: ● Until Babel 5, all transformations were automatically transpiled. Starting with Babel 6, everything is opt-in. ● Available transforms: react, es2015, ecmascript stages. Add these in .babelrc if needed. > touch .babelrc { "presets": ["es2015", "stage-1"] }
  • 21. AGENDA: Let’s create a Webpack build 1. ES6 transpile 2. Vendor bundles + Code splitting 3. Preprocessors + Postprocessors 4. Minify JS and CSS + source maps 5. Loading assets: images + fonts 6. Development server 7. File watcher + HML* 8. Environment variables 9. Cache invalidation with hashes 10. i18n* 11. GZIP compression 12. Performance monitoring *Framework dependent
  • 22. AGENDA: Let’s create a Webpack build 1. ES6 transpile 2. Vendor bundles + Code splitting 3. Preprocessors + Postprocessors 4. Minify JS and CSS + source maps 5. Loading assets: images + fonts 6. Development server 7. File watcher + HML* 8. Environment variables 9. Cache invalidation with hashes 10. i18n* 11. GZIP compression 12. Performance monitoring *Framework dependent
  • 23. Preprocessors and Postprocessors > yarn add style-loader css-loader --dev > yarn add sass-loader node-sass autoprefixer-loader --dev > yarn add extract-text-webpack-plugin@^1.0.1 --dev Available version: style-loader 0.21.0 css-loader 0.28.11 node-sass 4.9.0 sass-loader 7.0.1 @28-05-2018 Available version: autoprefixer-loader 3.2.0 extract-text-webpack-plugin 3.0.2 latest 1.0.1 (webpack ^1.*)
  • 24. Preprocessors and Postprocessors We preprocess SCSS into CSS w/ sass-loader, node-sass. We load CSS into the document’s head w/ style-loader, css-loader. We postprocess the properties with desired vendor prefixes w/ autoprefixer-loader We import the output styles into the file via a link tag instead of inlining w/ extract-text-webpack-plugin.
  • 25. Preprocessors and Postprocessors Let’s add some SCSS files… > touch src/master.scss styles/_colors.scss styles/_typography.scss
  • 26. Preprocessors and Postprocessors Let’s configure the loaders const ExtractTextPlugin = require("extract-text-webpack-plugin"); module.exports = { entry: { app: ['./src/index.js','./src/master.scss'] }, output: { path: path.join(__dirname, 'build'), filename: '[name].bundle.js' }, module.exports = { ... module: { loaders: [ { test: /.scss$/, loader: ExtractTextPlugin.extract('style', 'css-loader!autoprefixer?browsers=last 2 versions!sass') } ] }, plugins: [new ExtractTextPlugin("[name].bundle.css")]
  • 27. AGENDA: Let’s create a Webpack build 1. ES6 transpile 2. Vendor bundles + Code splitting 3. Preprocessors + Postprocessors 4. Minify JS and CSS + source maps 5. Loading assets: images + fonts 6. Development server 7. File watcher + HML* 8. Environment variables 9. Cache invalidation with hashes 10. i18n* 11. GZIP compression 12. Performance monitoring *Framework dependent
  • 28. AGENDA: Let’s create a Webpack build 1. ES6 transpile 2. Vendor bundles + Code splitting 3. Preprocessors + Postprocessors 4. Minify JS and CSS + source maps 5. Loading assets: images + fonts 6. Development server 7. File watcher + HML* 8. Environment variables 9. Cache invalidation with hashes 10. i18n* 11. GZIP compression 12. Performance monitoring *Framework dependent
  • 29. Development server > yarn add webpack-dev-server@^1.16.5 --dev Available versions: 3.1.5 latest 1.16.5 (webpack ^1.*) @28-05-2018
  • 30. Development server Configuring the plugin webpack.config.js module.exports = { ... devServer: { inline: true, port: 1337 }, … }; Change NPM scripts package.json "scripts": { "start": "webpack-dev-server", "build:prod": "webpack", "clean": "rm -rf build" },
  • 31. AGENDA: Let’s create a Webpack build 1. ES6 transpile 2. Vendor bundles + Code splitting 3. Preprocessors + Postprocessors 4. Minify JS and CSS + source maps 5. Loading assets: images + fonts 6. Development server 7. File watcher + HML* 8. Environment variables 9. Cache invalidation with hashes 10. i18n* 11. GZIP compression 12. Performance monitoring *Framework dependent
  • 32. AGENDA: Let’s create a Webpack build 1. ES6 transpile 2. Vendor bundles + Code splitting 3. Preprocessors + Postprocessors 4. Minify JS and CSS + source maps 5. Loading assets: images + fonts 6. Development server 7. File watcher + HML* 8. Environment variables 9. Cache invalidation with hashes 10. i18n* 11. GZIP compression 12. Performance monitoring *Framework dependent
  • 33. File watcher + Hot Module Replacement* File watching is a built-in feature of Webpack. In order to enable it, we add a --watch. package.json "scripts": { "start": "webpack-dev-server", "build:dev": "webpack --watch", "build:prod": "webpack", "clean": "rm -rf build" }, Thus: > npm run build:dev > npm start Note! Don’t forget to: - require the master.scss file in index.js for parsing - include the bundles in your index.html file
  • 34. File watcher + Hot Module Replacement* HMR (Hot Module replacement) allows webpack to reload only chunks of JS code, instead of the whole code base. It can be used with Redux or specific framework loaders for HML. e.g.: react-hot-loader, vue-hot-loader
  • 35. AGENDA: Let’s create a Webpack build 1. ES6 transpile 2. Vendor bundles + Code splitting 3. Preprocessors + Postprocessors 4. Minify JS and CSS + source maps 5. Loading assets: images + fonts 6. Development server 7. File watcher + HML* 8. Environment variables 9. Cache invalidation with hashes 10. i18n* 11. GZIP compression 12. Performance monitoring *Framework dependent
  • 36. AGENDA: Let’s create a Webpack build 1. ES6 transpile 2. Vendor bundles + Code splitting 3. Preprocessors + Postprocessors 4. Minify JS and CSS + source maps 5. Loading assets: images + fonts 6. Development server 7. File watcher + HML* 8. Environment variables 9. Cache invalidation with hashes 10. i18n* 11. GZIP compression 12. Performance monitoring *Framework dependent
  • 37. Loading assets: images and fonts Q: Why use a Loader for images? A: Performance Q: How is it better performing? A: The images are encrypted into base64 and injected into the DOM tree. In other words less HTTP requests. Q: Is there a downside? A: Yes, the image source is assigned via JS. You will manage the images from outside HTML and crawlers will not be able to reach it without prerendering.
  • 38. Loading assets: images and fonts > yarn add url-loader file-loader --dev Available versions: url-loader 1.0.1 file-loader 1.1.11 @28-05-2018
  • 39. Loading assets: images and fonts { test: /.(png|jp(e*)g|svg)$/, loader: 'url-loader?limit=900000' }, { test: /.woff2?(?v=d+.d+.d+)?$/, loader: 'url-loader', use: { options: { mimetype: 'application/font-woff', name: "./src/fonts/[name].[ext]" } } }
  • 40. Loading assets: images and fonts index.html <img id="manticore-img" alt="Manticore" title="Manticore"> index.js import manticoreimg from './images/manticore.png'; const manticore = document.getElementById('manticore-img'); if (manticore) manticore.src = manticoreimg; import pattern from './images/pattern.png'; master.scss footer { background: $color-main url('images/pattern.png') left top repeat-x; }
  • 41. Loading assets: images and fonts typography.scss @font-face { font-family: 'Nunito'; ...} @font-face { font-family: 'Space Mono'; ...} $font-main: 'Space Mono', monospace; $font-secondary: 'Nunito', sans-serif;
  • 42. AGENDA: Let’s create a Webpack build 1. ES6 transpile 2. Vendor bundles + Code splitting 3. Preprocessors + Postprocessors 4. Minify JS and CSS + source maps 5. Loading assets: images + fonts 6. Development server 7. File watcher + HML* 8. Environment variables 9. Cache invalidation with hashes 10. i18n* 11. GZIP compression 12. Performance monitoring *Framework dependent
  • 43. AGENDA: Let’s create a Webpack build 1. ES6 transpile 2. Vendor bundles + Code splitting 3. Preprocessors + Postprocessors 4. Minify JS and CSS + source maps 5. Loading assets: images + fonts 6. Development server 7. File watcher + HML* 8. Environment variables 9. Cache invalidation with hashes 10. i18n* 11. GZIP compression 12. Performance monitoring *Framework dependent
  • 44. commons.bundle.js OR vendors.bundle.js Vendor bundles and Code splitting Q: What is Code Splitting? A: Multiple bundle files setup page1.js page2.js page3.js page1.bundle.js page2.bundle.js page3.bundle.js
  • 45. Vendor bundles and Code splitting We will use CommonsChunks, a preinstalled Webpack plugin. Possible configurations: - Detect repeating dependencies in all entries and split into commons.bundle.js + unique bundles - Manually define dependencies for a vendor.bundle.js which should be included on every page.
  • 46. Vendor bundles and Code splitting webpack.config.js const webpack = require('webpack'); const CommonsChunkPlugin = require('./node_modules/webpack/lib/optimize/CommonsChunkPlugin'); module.exports = { entry: { app: [ './src/index.js', './src/master.scss' ], page1: './src/scripts/page1.js', page2: './src/scripts/page2.js', vendor: ['angular'] }, ... module.exports = { ... plugins: { new webpack.optimize.CommonsChunkPlugin({ name: 'vendor', filename: 'vendor.bundle.js', minChunks: Infinity }), }
  • 47. AGENDA: Let’s create a Webpack build 1. ES6 transpile 2. Vendor bundles + Code splitting 3. Preprocessors + Postprocessors 4. Minify JS and CSS + source maps 5. Loading assets: images + fonts 6. Development server 7. File watcher + HML* 8. Environment variables 9. Cache invalidation with hashes 10. i18n* 11. GZIP compression 12. Performance monitoring *Framework dependent
  • 48. AGENDA: Let’s create a Webpack build 1. ES6 transpile 2. Vendor bundles + Code splitting 3. Preprocessors + Postprocessors 4. Minify JS and CSS + source maps 5. Loading assets: images + fonts 6. Development server 7. File watcher + HML* 8. Environment variables 9. Cache invalidation with hashes 10. i18n* 11. GZIP compression 12. Performance monitoring *Framework dependent
  • 49. Minify JS and CSS + source maps Source maps are a built-in feature. Source maps establish the connection between bundles and the original files. They have a performance drawback. It is best practice to disable them in production. webpack.config.js module.exports = { ... devtool: 'source-map', ... }
  • 50.
  • 51. Minify JS and CSS + source maps In order to map bundled CSS with SCSS, we need to modify it’s loader params module: { loaders: [ {loader: ExtractTextPlugin.extract('style', 'css-loader?sourceMap!autoprefixer?browsers=last 2 versions!sass)} ]}
  • 52. Minify JS and CSS + source maps We can minify (uglify) bundles with another built-in plugin: UglifyJsPlugin. const UglifyJsPlugin = require('./node_modules/webpack/lib/optimize/UglifyJsPlugin'); module.exports = { ... plugins: [ new webpack.optimize.UglifyJsPlugin({ compress: { warnings: false, drop_console: false } }) ] }
  • 53.
  • 54. AGENDA: Let’s create a Webpack build 1. ES6 transpile 2. Vendor bundles + Code splitting 3. Preprocessors + Postprocessors 4. Minify JS and CSS + source maps 5. Loading assets: images + fonts 6. Development server 7. File watcher + HML* 8. Environment variables 9. Cache invalidation with hashes 10. i18n* 11. GZIP compression 12. Performance monitoring *Framework dependent
  • 55. AGENDA: Let’s create a Webpack build 1. ES6 transpile 2. Vendor bundles + Code splitting 3. Preprocessors + Postprocessors 4. Minify JS and CSS + source maps 5. Loading assets: images + fonts 6. Development server 7. File watcher + HML* 8. Environment variables 9. Cache invalidation with hashes 10. i18n* 11. GZIP compression 12. Performance monitoring *Framework dependent
  • 56. ENV variables Environment variables are not a Webpack feature. We can send value through NPM scripts. "scripts": { "start": "NODE_ENV=production webpack-dev-server", "build:dev": "NODE_ENV=development webpack-dev-server --watch", "build:prod": "NODE_ENV=production webpack", "build:debugprod": "NODE_ENV=debugproduction webpack-dev-server --watch", "clean": "rm -rf build" },
  • 57. ENV variables We can catch inside webpack.config.js the values send through NPM scripts as follows: /** * ENV variables */ const env = process.env.NODE_ENV; const isDev = env === 'development'; const isProd = env === 'production'; const debugProd = env === 'debugproduction';
  • 58. ENV variables Based on our needs, we define specific behaviour for production and development. e.g.: devtool: isProd ? false : 'source-map', (isDev || debugProd) ? module.exports.plugins.push(new BundleAnalyzerPlugin()) : '';
  • 59. AGENDA: Let’s create a Webpack build 1. ES6 transpile 2. Vendor bundles + Code splitting 3. Preprocessors + Postprocessors 4. Minify JS and CSS + source maps 5. Loading assets: images + fonts 6. Development server 7. File watcher + HML* 8. Environment variables 9. Cache invalidation with hashes 10. i18n* 11. GZIP compression 12. Performance monitoring *Framework dependent
  • 60. AGENDA: Let’s create a Webpack build 1. ES6 transpile 2. Vendor bundles + Code splitting 3. Preprocessors + Postprocessors 4. Minify JS and CSS + source maps 5. Loading assets: images + fonts 6. Development server 7. File watcher + HML* 8. Environment variables 9. Cache invalidation with hashes 10. i18n* 11. GZIP compression 12. Performance monitoring *Framework dependent
  • 61. Cache invalidation with hashes Webpack offers several placeholders. We’ve used [name] before for passing the same filename from dev files to bundles. We can also use [chunkhash] and [contenthash] to add a hash within the filenames.
  • 62. Cache invalidation with hashes We will update our build filenames as follows: module.exports = { ... output: { path: path.join(__dirname, 'build'), filename: '[name].bundle.[chunkhash:4].js' }, … plugins: [ new ExtractTextPlugin('[name].min.[contenthash:4].css'), … ]
  • 63. Cache invalidation with hashes Webpack can inject the bundle names (with autogenerated hashes) dynamically with a loader. > yarn add html-webpack-plugin --dev
  • 64. Cache invalidation with hashes Configure html-webpack-plugin: const HtmlWebpackPlugin = require('html-webpack-plugin'); module.exports = { ... plugins: [ ... new HtmlWebpackPlugin({ template: path.join(__dirname, 'index.html'), filename: 'index.html', chunks: ['vendor', 'app'] }), ... ]
  • 65. Cache invalidation with hashes Note: Remove from index.html the CSS link and bundle scripts! A new index.html file will be created within build, with the hashed bundles injected and served in the browser.
  • 67. AGENDA: Let’s create a Webpack build 1. ES6 transpile 2. Vendor bundles + Code splitting 3. Preprocessors + Postprocessors 4. Minify JS and CSS + source maps 5. Loading assets: images + fonts 6. Development server 7. File watcher + HML* 8. Environment variables 9. Cache invalidation with hashes 10. i18n* 11. GZIP compression 12. Performance monitoring *Framework dependent
  • 68. AGENDA: Let’s create a Webpack build 1. ES6 transpile 2. Vendor bundles + Code splitting 3. Preprocessors + Postprocessors 4. Minify JS and CSS + source maps 5. Loading assets: images + fonts 6. Development server 7. File watcher + HML* 8. Environment variables 9. Cache invalidation with hashes 10. i18n* 11. GZIP compression 12. Performance monitoring *Framework dependent
  • 69. Internationlization i18n* There are all sorts of i18n loaders based on the framework that you will use in your project. i18n-express react-i18next @ngx-translate/core
  • 70. AGENDA: Let’s create a Webpack build 1. ES6 transpile 2. Vendor bundles + Code splitting 3. Preprocessors + Postprocessors 4. Minify JS and CSS + source maps 5. Loading assets: images + fonts 6. Development server 7. File watcher + HML* 8. Environment variables 9. Cache invalidation with hashes 10. i18n* 11. GZIP compression 12. Performance monitoring *Framework dependent
  • 71. AGENDA: Let’s create a Webpack build 1. ES6 transpile 2. Vendor bundles + Code splitting 3. Preprocessors + Postprocessors 4. Minify JS and CSS + source maps 5. Loading assets: images + fonts 6. Development server 7. File watcher + HML* 8. Environment variables 9. Cache invalidation with hashes 10. i18n* 11. GZIP compression 12. Performance monitoring *Framework dependent
  • 72. GZip compression We can compile our assets into binary files e.g.: vendor.bundle.js -> vendor.bundle.js.gz > yarn add compression-webpack-plugin --dev
  • 73. GZip compression webpack.config.js const CompressionPlugin = require("compression-webpack-plugin"); module.exports = { ... new CompressionPlugin({ asset : "[path].gz[query]", algorithm : "gzip", test : /.js$|.css$|.html$/, threshold : 10240, minRatio : 0.8 }) }
  • 74. GZip compression Note: Serving gzip files can be done through NGINX. Binary files aren’t supported by all browsers. NGINX can provide the normal file as fallback.
  • 75. AGENDA: Let’s create a Webpack build 1. ES6 transpile 2. Vendor bundles + Code splitting 3. Preprocessors + Postprocessors 4. Minify JS and CSS + source maps 5. Loading assets: images + fonts 6. Development server 7. File watcher + HML* 8. Environment variables 9. Cache invalidation with hashes 10. i18n* 11. GZIP compression 12. Performance monitoring *Framework dependent
  • 76. AGENDA: Let’s create a Webpack build 1. ES6 transpile 2. Vendor bundles + Code splitting 3. Preprocessors + Postprocessors 4. Minify JS and CSS + source maps 5. Loading assets: images + fonts 6. Development server 7. File watcher + HML* 8. Environment variables 9. Cache invalidation with hashes 10. i18n* 11. GZIP compression 12. Performance monitoring *Framework dependent
  • 77. Performance monitoring We can have a visual preview of our bundles with the help of webpack-bundle-analyzer plugin.
  • 78. Performance monitoring > yarn add webpack-bundle-analyzer --dev webpack.config.js const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; module.exports = { plugins: [ ... new BundleAnalyzerPlugin()) ] };
  • 79.
  • 80. AGENDA: Let’s create a Webpack build 1. ES6 transpile 2. Vendor bundles + Code splitting 3. Preprocessors + Postprocessors 4. Minify JS and CSS + source maps 5. Loading assets: images + fonts 6. Development server 7. File watcher + HML* 8. Environment variables 9. Cache invalidation with hashes 10. i18n* 11. GZIP compression 12. Performance monitoring *Framework dependent
  • 83. REFERENCES: Official documentation: https://webpack.js.org/ Online courses (Free & Paid): https://webpack.academy Good stuff: https://survivejs.com/webpack/fore word/