SlideShare a Scribd company logo
1 of 62
Download to read offline
Czym jest webpack
i dlaczego chcesz go używać?
Marcin Gajda
The Software House
W telegraficznym skrócie
webpack przetwarza moduły i ich zależności i
tworzy statyczne assety dla naszej aplikacji
Instalacja i uruchamianie
npm init
sudo npm install webpack -g
webpack ./entry_point.js bundle.js
# lub...
webpack --config webpack.config.js
Instalacja i uruchamianie
npm init
sudo npm install webpack -g
webpack ./entry_point.js bundle.js
# lub...
webpack --config webpack.config.js
Krok pierwszy
Wczytanie punktów wejściowych aplikacji
cat.js
Plik konfiguracyjny webpack.config.js
module.exports = {
context: __dirname+'/assets',
entry: {
cat: './cat.js'
},
output: {
path: 'compiled',
filename: '[name]-bundle.js',
publicPath: 'compiled/'
},
module: {},
plugins: {},
resolve: {}
};
Plik konfiguracyjny
module.exports = {
context: __dirname+'/assets',
entry: {
cat: './cat.js'
},
output: {
path: 'compiled',
filename: '[name]-bundle.js',
publicPath: 'compiled/'
},
module: {},
plugins: {},
resolve: {}
};
webpack.config.js
assets/cat.js → compiled/cat-bundle.js
Krok drugi
Kompilacja skryptów, grafik, styli itd.
cat.js
head.js body.js
Krok drugi
Kompilacja skryptów, grafik, styli itd.
cat.js
head.js body.js
Importowanie statyczne
catsHead = require('./cat/head.js');
catsBody = require('./cat/body.js');
console.log(catsHead());
console.log(catsBody());
head = function(){ return 'cats head' };
module.exports = head;
assets/cat/head.js
assets/cat.js
body = function(){ return 'cats body' };
module.exports = body;
assets/cat/body.js
cat.js
head.js body.js
Test importowania statycznego
/uszanowanko/webpack> webpack --display-modules
Test importowania statycznego
/uszanowanko/webpack> webpack --display-modules
Hash: f7f0a8c9c6d85acfaf68
Version: webpack 1.12.14
Time: 57ms
Asset Size Chunks Chunk Names
cat-bundle.js 2.05 kB 0 [emitted] cat
[0] ./cat.js 122 bytes {0} [built]
[1] ./cat/head.js 66 bytes {0} [built]
[2] ./cat/body.js 66 bytes {0} [built]
/uszanowanko/webpack>
Importowanie dynamiczne
require(['./cat/head', './cat/body'],
function(catsHead, catsBody){
console.log(catsHead());
console.log(catsBody());
}
);
head = function(){ return 'cats head' };
module.exports = head;
assets/cat/head.js
assets/cat.js
body = function(){ return 'cats body' };
module.exports = body;
assets/cat/body.js
cat.js
head.js body.js
Test importowania dynamicznego
/uszanowanko/webpack> webpack --display-modules
Test importowania dynamicznego
/uszanowanko/webpack> webpack --display-modules
Hash: f7f0a8c9c6d85acfaf68
Version: webpack 1.12.14
Time: 57ms
Asset Size Chunks Chunk Names
cat-bundle.js 4.02 kB 0 [emitted] cat
1.1-bundle.js 434 kB 1 [emitted]
[0] ./cat.js 151 bytes {0} [built]
[1] ./cat/head.js 66 bytes {1} [built]
[2] ./cat/body.js 66 bytes {1} [built]
/uszanowanko/webpack>
Wiele “entry pointów”
module.exports = {
//...
entry: {
cat: './cat.js',
dog: './dog.js'
},
//...
};
webpack.config.js
assets/cat.js → compiled/cat-bundle.js
assets/dog.js → compiled/dog-bundle.js
Wiele “entry pointów”
module.exports = {
//...
entry: {
cat: './cat.js',
dog: './dog.js'
},
//...
};
webpack.config.js
assets/cat.js → compiled/cat-bundle.js
assets/dog.js → compiled/dog-bundle.js
dog.js
head.coffee body.coffee
cat.js
head.js body.js
Wiele “entry pointów”
module.exports = {
//...
entry: {
cat: './cat.js',
dog: './dog.js'
},
//...
};
webpack.config.js
assets/cat.js → compiled/cat-bundle.js
assets/dog.js → compiled/dog-bundle.js
dog.js
head.coffee body.coffee
cat.js
head.js body.js
Loadery
module.exports = {
//...
resolve: {
extensions: ['', '.coffee', '.js']
},
module: {
loaders: [
{ test: /.coffee$/, loader: 'coffee-loader' }
]
}
};
webpack.config.js
Loadery to małe moduły, które przetwarzają wskazane im pliki i
zwracają je w formie, która może zostać zapisana lub ulec dalszemu
przetwarzaniu przez następne loadery.
npm install coffee-script coffee-loader --save
Loadery
module.exports = {
//...
resolve: {
extensions: ['', '.coffee', '.js']
},
module: {
loaders: [
{ test: /.coffee$/, loader: 'coffee-loader' }
]
}
};
webpack.config.js
Loadery to małe moduły, które przetwarzają wskazane im pliki i
zwracają je w formie, która może zostać zapisana lub ulec dalszemu
przetwarzaniu przez następne loadery.
npm install coffee-script coffee-loader --save
Transpilacja
dogsHead = require('./dog/head');
dogsBody = require('./dog/body');
console.log(dogsHead());
console.log(dogsBody());
head = -> "dogs head"
module.exports = head;
assets/dog/head.coffee
assets/dog.js
body = -> "dogs body"
module.exports = body;
assets/dog/body.coffee
dog.js
head.coffee body.coffee
Transpilacja
/uszanowanko/webpack> webpack --display-modules
Transpilacja
/uszanowanko/webpack> webpack --display-modules
Hash: 035ccd9c22a0de9b0c61
Version: webpack 1.12.14
Time: 115ms
Asset Size Chunks Chunk Names
cat-bundle.js 4.02 kB 0 [emitted] cat
1.1-bundle.js 434 bytes 1 [emitted]
dog-bundle.js 2.13 kB 2 [emitted] dog
[0] ./cat.js 151 bytes {0} [built]
[0] ./dog.js 122 bytes {2} [built]
[1] ./cat/head.js 66 bytes {1} [built]
[2] ./cat/body.js 66 bytes {1} [built]
[3] ./dog/head.coffee 80 bytes {2} [built]
[4] ./dog/body.coffee 80 bytes {2} [built]
Transpilacja
/uszanowanko/webpack> webpack --display-modules
Hash: 035ccd9c22a0de9b0c61
Version: webpack 1.12.14
Time: 115ms
Asset Size Chunks Chunk Names
cat-bundle.js 4.02 kB 0 [emitted] cat
1.1-bundle.js 434 bytes 1 [emitted]
dog-bundle.js 2.13 kB 2 [emitted] dog
[0] ./cat.js 151 bytes {0} [built]
[0] ./dog.js 122 bytes {2} [built]
[1] ./cat/head.js 66 bytes {1} [built]
[2] ./cat/body.js 66 bytes {1} [built]
[3] ./dog/head.coffee 80 bytes {2} [built]
[4] ./dog/body.coffee 80 bytes {2} [built]
Grafiki w skryptach
var $ = require('jquery');
var catHeadImage = require('../images/cat_head.png');
$('.head').append('<img src="'+catHeadImage+'" />');
//...
assets/cat/head.js
module.exports = {
//...
module: {
loaders: [
{ test: /.coffee$/, loader: "coffee-loader" },
{ test: /.(png|jpg|gif|bmp)/, loader: "file" }
]
}
};
webpack.config.js
Grafiki w skryptach
/uszanowanko/webpack> webpack --display-modules
Grafiki w skryptach
/uszanowanko/webpack> webpack --display-modules
Hash: a2bd8c43ab5d095496be
Version: webpack 1.12.14
Time: 342ms
Asset Size Chunks Chunk Names
5e8e95d00a8673e044ce5ae85a86d22f.png 134 kB [emitted]
cat-bundle.js 4.02 kB 0 [emitted] cat
1.1-bundle.js 268 kB 1 [emitted]
dog-bundle.js 2.14 kB 2 [emitted] dog
[0] ./cat.js 151 bytes {0} [built]
[0] ./dog.js 122 bytes {2} [built]
[1] ./cat/head.js 224 bytes {1} [built]
[2] ../~/jquery/dist/jquery.js 259 kB {1} [built]
[3] ./images/cat_head.png 82 bytes {1} [built]
[4] ./cat/body.js 66 bytes {1} [built]
[5] ./dog/head.coffee 80 bytes {2} [built]
[6] ./dog/body.coffee 80 bytes {2} [built]
CSS
require('../styles/cats_body');
//...
assets/cat/body.js
.body{
width: 300px;
height: 250px;
background: url('~/images/cat_body.png');
}
assets/styles/cats_body.scss
CSS
module.exports = {
//...
resolve: {
extensions: ['', '.coffee', '.js', '.scss']
},
module: {
loaders: [
//...
{ test: /.scss$/, loaders: ["style", "css", "sass"] }
]
}
};
webpack.config.js
CSS
/uszanowanko/webpack> webpack --display-modules
CSS
/uszanowanko/webpack> webpack --display-modules
Hash: bdb3652f781ccb917057
Version: webpack 1.12.14
Time: 2366ms
Asset Size Chunks Chunk Names
5e8e95d00a8673e044ce5ae85a86d22f.png 134 kB [emitted]
44402ef52711a576ca7d32819295f64e.png 188 kB [emitted]
cat-bundle.js 4.02 kB 0 [emitted] cat
1.1-bundle.js 279 kB 1 [emitted]
dog-bundle.js 2.12 kB 2 [emitted] dog
[0] ./cat.js 151 bytes {0} [built]
[0] ./dog.js 122 bytes {2} [built]
[1] ./cat/head.js 224 bytes {1} [built]
[2] ../~/jquery/dist/jquery.js 259 kB {1} [built]
[3] ./images/cat_head.png 82 bytes {1} [built]
[4] ./cat/body.js 99 bytes {1} [built]
[5] ./styles/cats_body.scss 1.06 kB {1} [built]
[6] ../~/css-loader!../~/sass-loader!./styles/cats_body.scss 268 bytes {1} [built]
[7] ../~/css-loader/lib/css-base.js 1.51 kB {1} [built]
[8] ./images/cat_body.png 82 bytes {1} [built]
[9] ../~/style-loader/addStyles.js 7.21 kB {1} [built]
[10] ./dog/head.coffee 80 bytes {2} [built]
[11] ./dog/body.coffee 80 bytes {2} [built]
Test webpacka
<html>
<head>
<meta charset="UTF-8">
<title>Cat</title>
<script src="compiled/cat-bundle.js"></script>
</head>
<body>
<div class="head"></div>
<div class="body"></div>
</body>
</html>
cat.html
Test webpacka
<html>
<head>
<meta charset="UTF-8">
<title>Cat</title>
<script src="compiled/cat-bundle.js"></script>
</head>
<body>
<div class="head"></div>
<div class="body"></div>
</body>
</html>
cat.html
Test webpacka
<html>
<head>
<meta charset="UTF-8">
<title>Cat</title>
<script src="compiled/cat-bundle.js"></script>
</head>
<body>
<div class="head"></div>
<div class="body"></div>
</body>
</html>
cat.html
Test webpacka
Test webpacka
Test webpacka
Krok trzeci
Dodajemy dodatkowe wtyczki (plugins)
var ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
//...
plugins: [
new ExtractTextPlugin("styles-[name].css", {allChunks:true})
],
module: {
loaders: [
//...
{ test: /.scss$/, loader: ExtractTextPlugin.extract(["css", "sass"], {publicPath: ''}) }
]
}
};
webpack.config.js
Wtyczki to moduły, które pozwalają na wykonanie dodatkowych
czynności podczas działania skryptu webpacka. Mogą dodawać pliki,
usuwać je lub ponownie przetwarzać.
Ekstrakcja CSS
/uszanowanko/webpack> webpack
Ekstrakcja CSS
/uszanowanko/webpack> webpack
Hash: 1d336bd3e0dba1633bcc
Version: webpack 1.12.12
Time: 749ms
Asset Size Chunks Chunk Names
44402ef52711a576ca7d32819295f64e.png 188 kB [emitted]
5e8e95d00a8673e044ce5ae85a86d22f.png 134 kB [emitted]
cat-bundle.js 4.02 kB 0 [emitted] cat
1.1-bundle.js 268 kB 1 [emitted]
dog-bundle.js 2.15 kB 2 [emitted] dog
styles-cat.css 100 bytes 0 [emitted] cat
[0] ./cat.js 151 bytes {0} [built]
[0] ./dog.js 122 bytes {2} [built]
[1] ./cat/head.js 224 bytes {1} [built]
[4] ./cat/body.js 99 bytes {1} [built]
+ 5 hidden modules
Child extract-text-webpack-plugin:
Asset Size Chunks Chunk Names
44402ef52711a576ca7d32819295f64e.png 188 kB [emitted]
+ 3 hidden modules
Wspólne fragmenty kodu
Wspólne fragmenty kodu
uszanowanko = require('./common/uszanowanko');
uszanowanko();
//...
uszanowanko = require('./common/uszanowanko');
uszanowanko();
//...
assets/dog.js
assets/cat.js
$ = require('jquery');
wow = function(){
$('body').prepend('<h2>Uszanowanko, wow!</h2>');
};
module.exports = wow;
assets/common/uszanowanko.js
dog.jscat.js
uszanowanko.js
Wspólne fragmenty kodu
var webpack = require('webpack');
module.exports = {
//...
plugins: [
new webpack.optimize.CommonsChunkPlugin({
name: 'common',
filename: 'common.js',
chunks: ['dog', 'cat']
}),
//...
]
};
webpack.config.js
Wspólne fragmenty kodu
/uszanowanko/webpack> webpack
Wspólne fragmenty kodu
/uszanowanko/webpack> webpack
Hash: 644d6d78fe56c9b09505
Version: webpack 1.12.12
Time: 748ms
Asset Size Chunks Chunk Names
44402ef52711a576ca7d32819295f64e.png 188 kB [emitted]
5e8e95d00a8673e044ce5ae85a86d22f.png 134 kB [emitted]
cat-bundle.js 605 bytes 0 [emitted] cat
1.1-bundle.js 1.21 kB 1 [emitted]
dog-bundle.js 879 bytes 2 [emitted] dog
common.js 271 kB 3 [emitted] common
styles-cat.css 100 bytes 0 [emitted] cat
[0] ./cat.js 225 bytes {0} [built]
[0] ./dog.js 186 bytes {2} [built]
[1] ./common/uszanowanko.js 128 bytes {3} [built]
[3] ./cat/head.js 224 bytes {1} [built]
[5] ./cat/body.js 99 bytes {1} [built]
+ 5 hidden modules
Child extract-text-webpack-plugin:
Asset Size Chunks Chunk Names
44402ef52711a576ca7d32819295f64e.png 188 kB [emitted]
+ 3 hidden modules
Wspólne fragmenty kodu
/uszanowanko/webpack> webpack
Hash: 644d6d78fe56c9b09505
Version: webpack 1.12.12
Time: 748ms
Asset Size Chunks Chunk Names
44402ef52711a576ca7d32819295f64e.png 188 kB [emitted]
5e8e95d00a8673e044ce5ae85a86d22f.png 134 kB [emitted]
cat-bundle.js 605 bytes 0 [emitted] cat
1.1-bundle.js 1.21 kB 1 [emitted]
dog-bundle.js 879 bytes 2 [emitted] dog
common.js 271 kB 3 [emitted] common
styles-cat.css 100 bytes 0 [emitted] cat
[0] ./cat.js 225 bytes {0} [built]
[0] ./dog.js 186 bytes {2} [built]
[1] ./common/uszanowanko.js 128 bytes {3} [built]
[3] ./cat/head.js 224 bytes {1} [built]
[5] ./cat/body.js 99 bytes {1} [built]
+ 5 hidden modules
Child extract-text-webpack-plugin:
Asset Size Chunks Chunk Names
44402ef52711a576ca7d32819295f64e.png 188 kB [emitted]
+ 3 hidden modules
/uszanowanko/webpack> webpack
Hash: 1d336bd3e0dba1633bcc
Version: webpack 1.12.12
Time: 749ms
Asset Size Chunks Chunk Names
44402ef52711a576ca7d32819295f64e.png 188 kB [emitted]
5e8e95d00a8673e044ce5ae85a86d22f.png 134 kB [emitted]
cat-bundle.js 4.02 kB 0 [emitted] cat
1.1-bundle.js 268 kB 1 [emitted]
dog-bundle.js 2.15 kB 2 [emitted] dog
styles-cat.css 100 bytes 0 [emitted] cat
[0] ./cat.js 151 bytes {0} [built]
[0] ./dog.js 122 bytes {2} [built]
[1] ./cat/head.js 224 bytes {1} [built]
[4] ./cat/body.js 99 bytes {1} [built]
+ 5 hidden modules
Child extract-text-webpack-plugin:
Asset Size Chunks Chunk Names
44402ef52711a576ca7d32819295f64e.png 188 kB [emitted]
+ 3 hidden modules
Wspólne fragmenty kodu
/uszanowanko/webpack> webpack
Hash: 644d6d78fe56c9b09505
Version: webpack 1.12.12
Time: 748ms
Asset Size Chunks Chunk Names
44402ef52711a576ca7d32819295f64e.png 188 kB [emitted]
5e8e95d00a8673e044ce5ae85a86d22f.png 134 kB [emitted]
cat-bundle.js 605 bytes 0 [emitted] cat
1.1-bundle.js 1.21 kB 1 [emitted]
dog-bundle.js 879 bytes 2 [emitted] dog
common.js 271 kB 3 [emitted] common
styles-cat.css 100 bytes 0 [emitted] cat
[0] ./cat.js 225 bytes {0} [built]
[0] ./dog.js 186 bytes {2} [built]
[1] ./common/uszanowanko.js 128 bytes {3} [built]
[3] ./cat/head.js 224 bytes {1} [built]
[5] ./cat/body.js 99 bytes {1} [built]
+ 5 hidden modules
Child extract-text-webpack-plugin:
Asset Size Chunks Chunk Names
44402ef52711a576ca7d32819295f64e.png 188 kB [emitted]
+ 3 hidden modules
Inne ciekawe wtyczki
- UglifyJsPlugin - używa biblioteki UglifyJS by zmniejszyć rozmiar plików
- DedupePlugin - wyszukuje zduplikowane pliki i je łączy
- ProvidePlugin - automatycznie importuje moduły na podstawie zmiennych
- CleanupPlugin - czyści folder na kompilowane pliki przed emisją nowych
- AssetsPlugin - zrzuca do pliku JSON informacje o wyemitowanych plikach,
które należy dołączyć do dokumentu HTML
Inne ciekawe wtyczki
- UglifyJsPlugin - używa biblioteki UglifyJS by zmniejszyć rozmiar plików
- DedupePlugin - wyszukuje zduplikowane pliki i je łączy
- ProvidePlugin - automatycznie importuje moduły na podstawie zmiennych
- CleanupPlugin - czyści folder na kompilowane pliki przed emisją nowych
- AssetsPlugin - zrzuca do pliku JSON informacje o wyemitowanych plikach,
które należy dołączyć do dokumentu HTML
{
"cat": {
"js": "compiled/cat-bundle.js",
"css": "compiled/styles-cat.css"
},
"dog": {
"js": "compiled/dog-bundle.js"
},
"common": {
"js": "compiled/common.js"
}
}
Krok ostatni
Inne dodatki i ustawienia
module.exports = {
//...
devtool: 'source-map'
};
Krok ostatni
Inne dodatki i ustawienia
module.exports = {
//...
devtool: 'source-map'
};
Krok ostatni
Inne dodatki i ustawienia
module.exports = {
//...
devtool: 'source-map'
};
Krok ostatni
Inne dodatki i ustawienia
module.exports = {
//...
devtool: 'source-map'
};
Tryb watch
/uszanowanko/webpack> webpack --watch --progress
Tryb watch
/uszanowanko/webpack> webpack --watch --progress
Hash: 644d6d78fe56c9b09505
Version: webpack 1.12.12
Time: 748ms
Asset Size Chunks Chunk Names
44402ef52711a576ca7d32819295f64e.png 188 kB [emitted]
5e8e95d00a8673e044ce5ae85a86d22f.png 134 kB [emitted]
cat-bundle.js 605 bytes 0 [emitted] cat
1.1-bundle.js 1.21 kB 1 [emitted]
dog-bundle.js 879 bytes 2 [emitted] dog
common.js 271 kB 3 [emitted] common
styles-cat.css 100 bytes 0 [emitted] cat
[0] ./cat.js 225 bytes {0} [built]
[0] ./dog.js 186 bytes {2} [built]
[1] ./common/uszanowanko.js 128 bytes {3} [built]
[3] ./cat/head.js 224 bytes {1} [built]
[5] ./cat/body.js 99 bytes {1} [built]
+ 5 hidden modules
Child extract-text-webpack-plugin:
Asset Size Chunks Chunk Names
44402ef52711a576ca7d32819295f64e.png 188 kB [ emitted]
+ 3 hidden modules
Tryb watch
common.js 271 kB 3 [emitted] common
styles-cat.css 100 bytes 0 [emitted] cat
[0] ./cat.js 225 bytes {0} [built]
[0] ./dog.js 186 bytes {2} [built]
[1] ./common/uszanowanko.js 128 bytes {3} [built]
[3] ./cat/head.js 224 bytes {1} [built]
[5] ./cat/body.js 99 bytes {1} [built]
+ 5 hidden modules
Child extract-text-webpack-plugin:
Asset Size Chunks Chunk Names
44402ef52711a576ca7d32819295f64e.png 188 kB [emitted]
+ 3 hidden modules
Hash: 23ce8cce5f54a398b346
Version: webpack 1.12.12
Time: 13ms
Asset Size Chunks Chunk Names
cat-bundle.js 620 bytes 0 [emitted] cat
styles-cat.css 142 bytes 0 [emitted] cat
cat-bundle.js.map 507 bytes 0 [emitted] cat
styles-cat.css.map 91 bytes 0 [emitted] cat
[0] ./cat.js 201 bytes {0} [built]
+ 9 hidden modules
Serwer developerski
npm install webpack-dev-server -g
webpack-dev-server --content-base .
// http://localhost:8080/cat.html
Serwer developerski - autorealod
// Poprzez iframe --->
// http://localhost:8080/webpack-dev-server/cat.html
webpack-dev-server
// Standardowe
// http://localhost:8080/cat.html
webpack-dev-server --inline
Hot module reload
webpack-dev-server --inline --hot
if(module.hot) {
module.hot.accept("./common/uszanowanko" , function() {
var uszanowanko = require('./common/uszanowanko' );
var $ = require('jquery');
$('h2').remove();
uszanowanko();
});
}
Podsumowanie
Dlaczego chcesz używać webpacka?
- Potrzebujesz skalowalności w projekcie
- Masz duży projekt z dużą ilością wspólnych zależności
- Chcesz łatwo skonfigurować transpilację
- Lubisz porządek w zależnościach
- Nie lubisz zmiennych globalnych
A dlaczego nie chcesz?
- Masz istniejący projekt, który będzie trzeba migrować
- Bo naprawdę potrzebujesz task-runnera, a nie bundlera ;)
Kod z prezentacji
https://github.com/marcingajda/uszanowanko-webpack
Pytania?
@marcingajda91

More Related Content

What's hot

Ansible : what's ansible & use case by REX
Ansible :  what's ansible & use case by REXAnsible :  what's ansible & use case by REX
Ansible : what's ansible & use case by REXSaewoong Lee
 
Software Defined Datacenter
Software Defined DatacenterSoftware Defined Datacenter
Software Defined DatacenterNETWAYS
 
Puppet at janrain
Puppet at janrainPuppet at janrain
Puppet at janrainPuppet
 
Automated Java Deployments With Rpm
Automated Java Deployments With RpmAutomated Java Deployments With Rpm
Automated Java Deployments With RpmMartin Jackson
 
"Ops Tools with Perl" 2012/05/12 Hokkaido.pm
"Ops Tools with Perl" 2012/05/12 Hokkaido.pm"Ops Tools with Perl" 2012/05/12 Hokkaido.pm
"Ops Tools with Perl" 2012/05/12 Hokkaido.pmRyosuke IWANAGA
 
Apache hadoop 2_installation
Apache hadoop 2_installationApache hadoop 2_installation
Apache hadoop 2_installationsushantbit04
 
Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013grim_radical
 
Drupal Performance - SerBenfiquista.com Case Study
Drupal Performance - SerBenfiquista.com Case StudyDrupal Performance - SerBenfiquista.com Case Study
Drupal Performance - SerBenfiquista.com Case Studyhernanibf
 
Deploying
DeployingDeploying
Deployingsoon
 
Hacking ansible
Hacking ansibleHacking ansible
Hacking ansiblebcoca
 
Python And My Sq Ldb Module
Python And My Sq Ldb ModulePython And My Sq Ldb Module
Python And My Sq Ldb ModuleAkramWaseem
 
Ansible leveraging 2.0
Ansible leveraging 2.0Ansible leveraging 2.0
Ansible leveraging 2.0bcoca
 
Getting Started with Ansible
Getting Started with AnsibleGetting Started with Ansible
Getting Started with Ansibleahamilton55
 
Future Decoded - Node.js per sviluppatori .NET
Future Decoded - Node.js per sviluppatori .NETFuture Decoded - Node.js per sviluppatori .NET
Future Decoded - Node.js per sviluppatori .NETGianluca Carucci
 
Performance Improvements in Browsers
Performance Improvements in BrowsersPerformance Improvements in Browsers
Performance Improvements in Browsersjeresig
 
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)err
 
“warpdrive”, making Python web application deployment magically easy.
“warpdrive”, making Python web application deployment magically easy.“warpdrive”, making Python web application deployment magically easy.
“warpdrive”, making Python web application deployment magically easy.Graham Dumpleton
 
Datagrids with Symfony 2, Backbone and Backgrid
Datagrids with Symfony 2, Backbone and BackgridDatagrids with Symfony 2, Backbone and Backgrid
Datagrids with Symfony 2, Backbone and Backgrideugenio pombi
 

What's hot (20)

Ansible : what's ansible & use case by REX
Ansible :  what's ansible & use case by REXAnsible :  what's ansible & use case by REX
Ansible : what's ansible & use case by REX
 
Hadoop on aws amazon
Hadoop on aws amazonHadoop on aws amazon
Hadoop on aws amazon
 
Software Defined Datacenter
Software Defined DatacenterSoftware Defined Datacenter
Software Defined Datacenter
 
Puppet at janrain
Puppet at janrainPuppet at janrain
Puppet at janrain
 
Automated Java Deployments With Rpm
Automated Java Deployments With RpmAutomated Java Deployments With Rpm
Automated Java Deployments With Rpm
 
"Ops Tools with Perl" 2012/05/12 Hokkaido.pm
"Ops Tools with Perl" 2012/05/12 Hokkaido.pm"Ops Tools with Perl" 2012/05/12 Hokkaido.pm
"Ops Tools with Perl" 2012/05/12 Hokkaido.pm
 
Apache hadoop 2_installation
Apache hadoop 2_installationApache hadoop 2_installation
Apache hadoop 2_installation
 
Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013
 
Drupal Performance - SerBenfiquista.com Case Study
Drupal Performance - SerBenfiquista.com Case StudyDrupal Performance - SerBenfiquista.com Case Study
Drupal Performance - SerBenfiquista.com Case Study
 
Deploying
DeployingDeploying
Deploying
 
Hacking ansible
Hacking ansibleHacking ansible
Hacking ansible
 
Python And My Sq Ldb Module
Python And My Sq Ldb ModulePython And My Sq Ldb Module
Python And My Sq Ldb Module
 
Ansible leveraging 2.0
Ansible leveraging 2.0Ansible leveraging 2.0
Ansible leveraging 2.0
 
Getting Started with Ansible
Getting Started with AnsibleGetting Started with Ansible
Getting Started with Ansible
 
Future Decoded - Node.js per sviluppatori .NET
Future Decoded - Node.js per sviluppatori .NETFuture Decoded - Node.js per sviluppatori .NET
Future Decoded - Node.js per sviluppatori .NET
 
Build Automation 101
Build Automation 101Build Automation 101
Build Automation 101
 
Performance Improvements in Browsers
Performance Improvements in BrowsersPerformance Improvements in Browsers
Performance Improvements in Browsers
 
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
 
“warpdrive”, making Python web application deployment magically easy.
“warpdrive”, making Python web application deployment magically easy.“warpdrive”, making Python web application deployment magically easy.
“warpdrive”, making Python web application deployment magically easy.
 
Datagrids with Symfony 2, Backbone and Backgrid
Datagrids with Symfony 2, Backbone and BackgridDatagrids with Symfony 2, Backbone and Backgrid
Datagrids with Symfony 2, Backbone and Backgrid
 

Viewers also liked

Webpack - Czym jest webpack i dlaczego chcesz go używać? - wersja krótka
Webpack - Czym jest webpack i dlaczego chcesz go używać? - wersja krótkaWebpack - Czym jest webpack i dlaczego chcesz go używać? - wersja krótka
Webpack - Czym jest webpack i dlaczego chcesz go używać? - wersja krótkaMarcin Gajda
 
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
 
Webpack Tutorial, Uppsala JS
Webpack Tutorial, Uppsala JSWebpack Tutorial, Uppsala JS
Webpack Tutorial, Uppsala JSEmil Öberg
 
Honey's Data Dinner#7 webpack 包達人(入門)
Honey's Data Dinner#7 webpack 包達人(入門)Honey's Data Dinner#7 webpack 包達人(入門)
Honey's Data Dinner#7 webpack 包達人(入門)beehivedata
 
Bundling your front-end with Webpack
Bundling your front-end with WebpackBundling your front-end with Webpack
Bundling your front-end with WebpackDanillo Corvalan
 
webpack 101 slides
webpack 101 slideswebpack 101 slides
webpack 101 slidesmattysmith
 
Bundle your modules with Webpack
Bundle your modules with WebpackBundle your modules with Webpack
Bundle your modules with WebpackJake Peyser
 
webpack 入門
webpack 入門webpack 入門
webpack 入門Anna Su
 
Webpack
Webpack Webpack
Webpack DataArt
 

Viewers also liked (12)

Webpack - Czym jest webpack i dlaczego chcesz go używać? - wersja krótka
Webpack - Czym jest webpack i dlaczego chcesz go używać? - wersja krótkaWebpack - Czym jest webpack i dlaczego chcesz go używać? - wersja krótka
Webpack - Czym jest webpack i dlaczego chcesz go używać? - wersja krótka
 
Angular Restmod
Angular RestmodAngular Restmod
Angular Restmod
 
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
 
Webpack Tutorial, Uppsala JS
Webpack Tutorial, Uppsala JSWebpack Tutorial, Uppsala JS
Webpack Tutorial, Uppsala JS
 
Honey's Data Dinner#7 webpack 包達人(入門)
Honey's Data Dinner#7 webpack 包達人(入門)Honey's Data Dinner#7 webpack 包達人(入門)
Honey's Data Dinner#7 webpack 包達人(入門)
 
Bundling your front-end with Webpack
Bundling your front-end with WebpackBundling your front-end with Webpack
Bundling your front-end with Webpack
 
webpack 101 slides
webpack 101 slideswebpack 101 slides
webpack 101 slides
 
Webpack slides
Webpack slidesWebpack slides
Webpack slides
 
Bundle your modules with Webpack
Bundle your modules with WebpackBundle your modules with Webpack
Bundle your modules with Webpack
 
webpack 入門
webpack 入門webpack 入門
webpack 入門
 
reveal.js 3.0.0
reveal.js 3.0.0reveal.js 3.0.0
reveal.js 3.0.0
 
Webpack
Webpack Webpack
Webpack
 

Similar to Czym jest webpack i dlaczego chcesz go używać?

The hitchhiker's guide to the Webpack - Sara Vieira - Codemotion Amsterdam 2017
The hitchhiker's guide to the Webpack - Sara Vieira - Codemotion Amsterdam 2017The hitchhiker's guide to the Webpack - Sara Vieira - Codemotion Amsterdam 2017
The hitchhiker's guide to the Webpack - Sara Vieira - Codemotion Amsterdam 2017Codemotion
 
«От экспериментов с инфраструктурой до внедрения в продакшен»​
«От экспериментов с инфраструктурой до внедрения в продакшен»​«От экспериментов с инфраструктурой до внедрения в продакшен»​
«От экспериментов с инфраструктурой до внедрения в продакшен»​FDConf
 
От экспериментов с инфраструктурой до внедрения в продакшен
От экспериментов с инфраструктурой до внедрения в продакшенОт экспериментов с инфраструктурой до внедрения в продакшен
От экспериментов с инфраструктурой до внедрения в продакшенDmitry Makhnev
 
Resource Registries: Plone Conference 2014
Resource Registries: Plone Conference 2014Resource Registries: Plone Conference 2014
Resource Registries: Plone Conference 2014Rob Gietema
 
Custom gutenberg block development with React
Custom gutenberg block development with ReactCustom gutenberg block development with React
Custom gutenberg block development with ReactImran Sayed
 
Resource registries plone conf 2014
Resource registries plone conf 2014Resource registries plone conf 2014
Resource registries plone conf 2014Ramon Navarro
 
A re introduction to webpack - reactfoo - mumbai
A re introduction to webpack - reactfoo - mumbaiA re introduction to webpack - reactfoo - mumbai
A re introduction to webpack - reactfoo - mumbaiPraveen Puglia
 
Coscup x ruby conf tw 2021 google cloud buildpacks 剖析與實踐
Coscup x ruby conf tw 2021  google cloud buildpacks 剖析與實踐Coscup x ruby conf tw 2021  google cloud buildpacks 剖析與實踐
Coscup x ruby conf tw 2021 google cloud buildpacks 剖析與實踐KAI CHU CHUNG
 
Vue routing tutorial getting started with vue router
Vue routing tutorial getting started with vue routerVue routing tutorial getting started with vue router
Vue routing tutorial getting started with vue routerKaty Slemon
 
Custom gutenberg block development in react
Custom gutenberg block development in reactCustom gutenberg block development in react
Custom gutenberg block development in reactImran Sayed
 
How to replace rails asset pipeline with webpack?
How to replace rails asset pipeline with webpack?How to replace rails asset pipeline with webpack?
How to replace rails asset pipeline with webpack?Tomasz Bak
 
Building and deploying React applications
Building and deploying React applicationsBuilding and deploying React applications
Building and deploying React applicationsAstrails
 
The new static resources framework
The new static resources frameworkThe new static resources framework
The new static resources frameworkmarcplmer
 
Node.js & Twitter Bootstrap Crash Course
Node.js & Twitter Bootstrap Crash CourseNode.js & Twitter Bootstrap Crash Course
Node.js & Twitter Bootstrap Crash CourseAaron Silverman
 
! Modernizr v2.0.6 httpwww.modernizr.com Copyri.docx
!  Modernizr v2.0.6  httpwww.modernizr.com   Copyri.docx!  Modernizr v2.0.6  httpwww.modernizr.com   Copyri.docx
! Modernizr v2.0.6 httpwww.modernizr.com Copyri.docxMARRY7
 
reactjs-quiz..docs.pdf
reactjs-quiz..docs.pdfreactjs-quiz..docs.pdf
reactjs-quiz..docs.pdfAyanSarkar78
 
JS Lab`16. Владимир Воевидка: "Как работает браузер"
JS Lab`16. Владимир Воевидка: "Как работает браузер"JS Lab`16. Владимир Воевидка: "Как работает браузер"
JS Lab`16. Владимир Воевидка: "Как работает браузер"GeeksLab Odessa
 

Similar to Czym jest webpack i dlaczego chcesz go używać? (20)

The hitchhiker's guide to the Webpack - Sara Vieira - Codemotion Amsterdam 2017
The hitchhiker's guide to the Webpack - Sara Vieira - Codemotion Amsterdam 2017The hitchhiker's guide to the Webpack - Sara Vieira - Codemotion Amsterdam 2017
The hitchhiker's guide to the Webpack - Sara Vieira - Codemotion Amsterdam 2017
 
«От экспериментов с инфраструктурой до внедрения в продакшен»​
«От экспериментов с инфраструктурой до внедрения в продакшен»​«От экспериментов с инфраструктурой до внедрения в продакшен»​
«От экспериментов с инфраструктурой до внедрения в продакшен»​
 
От экспериментов с инфраструктурой до внедрения в продакшен
От экспериментов с инфраструктурой до внедрения в продакшенОт экспериментов с инфраструктурой до внедрения в продакшен
От экспериментов с инфраструктурой до внедрения в продакшен
 
Resource Registries: Plone Conference 2014
Resource Registries: Plone Conference 2014Resource Registries: Plone Conference 2014
Resource Registries: Plone Conference 2014
 
Custom gutenberg block development with React
Custom gutenberg block development with ReactCustom gutenberg block development with React
Custom gutenberg block development with React
 
Rails + Webpack
Rails + WebpackRails + Webpack
Rails + Webpack
 
Resource registries plone conf 2014
Resource registries plone conf 2014Resource registries plone conf 2014
Resource registries plone conf 2014
 
A re introduction to webpack - reactfoo - mumbai
A re introduction to webpack - reactfoo - mumbaiA re introduction to webpack - reactfoo - mumbai
A re introduction to webpack - reactfoo - mumbai
 
Coscup x ruby conf tw 2021 google cloud buildpacks 剖析與實踐
Coscup x ruby conf tw 2021  google cloud buildpacks 剖析與實踐Coscup x ruby conf tw 2021  google cloud buildpacks 剖析與實踐
Coscup x ruby conf tw 2021 google cloud buildpacks 剖析與實踐
 
Vue routing tutorial getting started with vue router
Vue routing tutorial getting started with vue routerVue routing tutorial getting started with vue router
Vue routing tutorial getting started with vue router
 
Lecture: Webpack 4
Lecture: Webpack 4Lecture: Webpack 4
Lecture: Webpack 4
 
Custom gutenberg block development in react
Custom gutenberg block development in reactCustom gutenberg block development in react
Custom gutenberg block development in react
 
How to replace rails asset pipeline with webpack?
How to replace rails asset pipeline with webpack?How to replace rails asset pipeline with webpack?
How to replace rails asset pipeline with webpack?
 
Building and deploying React applications
Building and deploying React applicationsBuilding and deploying React applications
Building and deploying React applications
 
The new static resources framework
The new static resources frameworkThe new static resources framework
The new static resources framework
 
SBT Concepts, part 2
SBT Concepts, part 2SBT Concepts, part 2
SBT Concepts, part 2
 
Node.js & Twitter Bootstrap Crash Course
Node.js & Twitter Bootstrap Crash CourseNode.js & Twitter Bootstrap Crash Course
Node.js & Twitter Bootstrap Crash Course
 
! Modernizr v2.0.6 httpwww.modernizr.com Copyri.docx
!  Modernizr v2.0.6  httpwww.modernizr.com   Copyri.docx!  Modernizr v2.0.6  httpwww.modernizr.com   Copyri.docx
! Modernizr v2.0.6 httpwww.modernizr.com Copyri.docx
 
reactjs-quiz..docs.pdf
reactjs-quiz..docs.pdfreactjs-quiz..docs.pdf
reactjs-quiz..docs.pdf
 
JS Lab`16. Владимир Воевидка: "Как работает браузер"
JS Lab`16. Владимир Воевидка: "Как работает браузер"JS Lab`16. Владимир Воевидка: "Как работает браузер"
JS Lab`16. Владимир Воевидка: "Как работает браузер"
 

Recently uploaded

Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Intelisync
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 

Recently uploaded (20)

Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 

Czym jest webpack i dlaczego chcesz go używać?

  • 1. Czym jest webpack i dlaczego chcesz go używać? Marcin Gajda The Software House
  • 2. W telegraficznym skrócie webpack przetwarza moduły i ich zależności i tworzy statyczne assety dla naszej aplikacji
  • 3. Instalacja i uruchamianie npm init sudo npm install webpack -g webpack ./entry_point.js bundle.js # lub... webpack --config webpack.config.js
  • 4. Instalacja i uruchamianie npm init sudo npm install webpack -g webpack ./entry_point.js bundle.js # lub... webpack --config webpack.config.js
  • 5. Krok pierwszy Wczytanie punktów wejściowych aplikacji cat.js
  • 6. Plik konfiguracyjny webpack.config.js module.exports = { context: __dirname+'/assets', entry: { cat: './cat.js' }, output: { path: 'compiled', filename: '[name]-bundle.js', publicPath: 'compiled/' }, module: {}, plugins: {}, resolve: {} };
  • 7. Plik konfiguracyjny module.exports = { context: __dirname+'/assets', entry: { cat: './cat.js' }, output: { path: 'compiled', filename: '[name]-bundle.js', publicPath: 'compiled/' }, module: {}, plugins: {}, resolve: {} }; webpack.config.js assets/cat.js → compiled/cat-bundle.js
  • 8. Krok drugi Kompilacja skryptów, grafik, styli itd. cat.js head.js body.js
  • 9. Krok drugi Kompilacja skryptów, grafik, styli itd. cat.js head.js body.js
  • 10. Importowanie statyczne catsHead = require('./cat/head.js'); catsBody = require('./cat/body.js'); console.log(catsHead()); console.log(catsBody()); head = function(){ return 'cats head' }; module.exports = head; assets/cat/head.js assets/cat.js body = function(){ return 'cats body' }; module.exports = body; assets/cat/body.js cat.js head.js body.js
  • 12. Test importowania statycznego /uszanowanko/webpack> webpack --display-modules Hash: f7f0a8c9c6d85acfaf68 Version: webpack 1.12.14 Time: 57ms Asset Size Chunks Chunk Names cat-bundle.js 2.05 kB 0 [emitted] cat [0] ./cat.js 122 bytes {0} [built] [1] ./cat/head.js 66 bytes {0} [built] [2] ./cat/body.js 66 bytes {0} [built] /uszanowanko/webpack>
  • 13. Importowanie dynamiczne require(['./cat/head', './cat/body'], function(catsHead, catsBody){ console.log(catsHead()); console.log(catsBody()); } ); head = function(){ return 'cats head' }; module.exports = head; assets/cat/head.js assets/cat.js body = function(){ return 'cats body' }; module.exports = body; assets/cat/body.js cat.js head.js body.js
  • 15. Test importowania dynamicznego /uszanowanko/webpack> webpack --display-modules Hash: f7f0a8c9c6d85acfaf68 Version: webpack 1.12.14 Time: 57ms Asset Size Chunks Chunk Names cat-bundle.js 4.02 kB 0 [emitted] cat 1.1-bundle.js 434 kB 1 [emitted] [0] ./cat.js 151 bytes {0} [built] [1] ./cat/head.js 66 bytes {1} [built] [2] ./cat/body.js 66 bytes {1} [built] /uszanowanko/webpack>
  • 16. Wiele “entry pointów” module.exports = { //... entry: { cat: './cat.js', dog: './dog.js' }, //... }; webpack.config.js assets/cat.js → compiled/cat-bundle.js assets/dog.js → compiled/dog-bundle.js
  • 17. Wiele “entry pointów” module.exports = { //... entry: { cat: './cat.js', dog: './dog.js' }, //... }; webpack.config.js assets/cat.js → compiled/cat-bundle.js assets/dog.js → compiled/dog-bundle.js dog.js head.coffee body.coffee cat.js head.js body.js
  • 18. Wiele “entry pointów” module.exports = { //... entry: { cat: './cat.js', dog: './dog.js' }, //... }; webpack.config.js assets/cat.js → compiled/cat-bundle.js assets/dog.js → compiled/dog-bundle.js dog.js head.coffee body.coffee cat.js head.js body.js
  • 19. Loadery module.exports = { //... resolve: { extensions: ['', '.coffee', '.js'] }, module: { loaders: [ { test: /.coffee$/, loader: 'coffee-loader' } ] } }; webpack.config.js Loadery to małe moduły, które przetwarzają wskazane im pliki i zwracają je w formie, która może zostać zapisana lub ulec dalszemu przetwarzaniu przez następne loadery. npm install coffee-script coffee-loader --save
  • 20. Loadery module.exports = { //... resolve: { extensions: ['', '.coffee', '.js'] }, module: { loaders: [ { test: /.coffee$/, loader: 'coffee-loader' } ] } }; webpack.config.js Loadery to małe moduły, które przetwarzają wskazane im pliki i zwracają je w formie, która może zostać zapisana lub ulec dalszemu przetwarzaniu przez następne loadery. npm install coffee-script coffee-loader --save
  • 21. Transpilacja dogsHead = require('./dog/head'); dogsBody = require('./dog/body'); console.log(dogsHead()); console.log(dogsBody()); head = -> "dogs head" module.exports = head; assets/dog/head.coffee assets/dog.js body = -> "dogs body" module.exports = body; assets/dog/body.coffee dog.js head.coffee body.coffee
  • 23. Transpilacja /uszanowanko/webpack> webpack --display-modules Hash: 035ccd9c22a0de9b0c61 Version: webpack 1.12.14 Time: 115ms Asset Size Chunks Chunk Names cat-bundle.js 4.02 kB 0 [emitted] cat 1.1-bundle.js 434 bytes 1 [emitted] dog-bundle.js 2.13 kB 2 [emitted] dog [0] ./cat.js 151 bytes {0} [built] [0] ./dog.js 122 bytes {2} [built] [1] ./cat/head.js 66 bytes {1} [built] [2] ./cat/body.js 66 bytes {1} [built] [3] ./dog/head.coffee 80 bytes {2} [built] [4] ./dog/body.coffee 80 bytes {2} [built]
  • 24. Transpilacja /uszanowanko/webpack> webpack --display-modules Hash: 035ccd9c22a0de9b0c61 Version: webpack 1.12.14 Time: 115ms Asset Size Chunks Chunk Names cat-bundle.js 4.02 kB 0 [emitted] cat 1.1-bundle.js 434 bytes 1 [emitted] dog-bundle.js 2.13 kB 2 [emitted] dog [0] ./cat.js 151 bytes {0} [built] [0] ./dog.js 122 bytes {2} [built] [1] ./cat/head.js 66 bytes {1} [built] [2] ./cat/body.js 66 bytes {1} [built] [3] ./dog/head.coffee 80 bytes {2} [built] [4] ./dog/body.coffee 80 bytes {2} [built]
  • 25. Grafiki w skryptach var $ = require('jquery'); var catHeadImage = require('../images/cat_head.png'); $('.head').append('<img src="'+catHeadImage+'" />'); //... assets/cat/head.js module.exports = { //... module: { loaders: [ { test: /.coffee$/, loader: "coffee-loader" }, { test: /.(png|jpg|gif|bmp)/, loader: "file" } ] } }; webpack.config.js
  • 26. Grafiki w skryptach /uszanowanko/webpack> webpack --display-modules
  • 27. Grafiki w skryptach /uszanowanko/webpack> webpack --display-modules Hash: a2bd8c43ab5d095496be Version: webpack 1.12.14 Time: 342ms Asset Size Chunks Chunk Names 5e8e95d00a8673e044ce5ae85a86d22f.png 134 kB [emitted] cat-bundle.js 4.02 kB 0 [emitted] cat 1.1-bundle.js 268 kB 1 [emitted] dog-bundle.js 2.14 kB 2 [emitted] dog [0] ./cat.js 151 bytes {0} [built] [0] ./dog.js 122 bytes {2} [built] [1] ./cat/head.js 224 bytes {1} [built] [2] ../~/jquery/dist/jquery.js 259 kB {1} [built] [3] ./images/cat_head.png 82 bytes {1} [built] [4] ./cat/body.js 66 bytes {1} [built] [5] ./dog/head.coffee 80 bytes {2} [built] [6] ./dog/body.coffee 80 bytes {2} [built]
  • 29. CSS module.exports = { //... resolve: { extensions: ['', '.coffee', '.js', '.scss'] }, module: { loaders: [ //... { test: /.scss$/, loaders: ["style", "css", "sass"] } ] } }; webpack.config.js
  • 31. CSS /uszanowanko/webpack> webpack --display-modules Hash: bdb3652f781ccb917057 Version: webpack 1.12.14 Time: 2366ms Asset Size Chunks Chunk Names 5e8e95d00a8673e044ce5ae85a86d22f.png 134 kB [emitted] 44402ef52711a576ca7d32819295f64e.png 188 kB [emitted] cat-bundle.js 4.02 kB 0 [emitted] cat 1.1-bundle.js 279 kB 1 [emitted] dog-bundle.js 2.12 kB 2 [emitted] dog [0] ./cat.js 151 bytes {0} [built] [0] ./dog.js 122 bytes {2} [built] [1] ./cat/head.js 224 bytes {1} [built] [2] ../~/jquery/dist/jquery.js 259 kB {1} [built] [3] ./images/cat_head.png 82 bytes {1} [built] [4] ./cat/body.js 99 bytes {1} [built] [5] ./styles/cats_body.scss 1.06 kB {1} [built] [6] ../~/css-loader!../~/sass-loader!./styles/cats_body.scss 268 bytes {1} [built] [7] ../~/css-loader/lib/css-base.js 1.51 kB {1} [built] [8] ./images/cat_body.png 82 bytes {1} [built] [9] ../~/style-loader/addStyles.js 7.21 kB {1} [built] [10] ./dog/head.coffee 80 bytes {2} [built] [11] ./dog/body.coffee 80 bytes {2} [built]
  • 32. Test webpacka <html> <head> <meta charset="UTF-8"> <title>Cat</title> <script src="compiled/cat-bundle.js"></script> </head> <body> <div class="head"></div> <div class="body"></div> </body> </html> cat.html
  • 33. Test webpacka <html> <head> <meta charset="UTF-8"> <title>Cat</title> <script src="compiled/cat-bundle.js"></script> </head> <body> <div class="head"></div> <div class="body"></div> </body> </html> cat.html
  • 34. Test webpacka <html> <head> <meta charset="UTF-8"> <title>Cat</title> <script src="compiled/cat-bundle.js"></script> </head> <body> <div class="head"></div> <div class="body"></div> </body> </html> cat.html
  • 38. Krok trzeci Dodajemy dodatkowe wtyczki (plugins) var ExtractTextPlugin = require("extract-text-webpack-plugin"); module.exports = { //... plugins: [ new ExtractTextPlugin("styles-[name].css", {allChunks:true}) ], module: { loaders: [ //... { test: /.scss$/, loader: ExtractTextPlugin.extract(["css", "sass"], {publicPath: ''}) } ] } }; webpack.config.js Wtyczki to moduły, które pozwalają na wykonanie dodatkowych czynności podczas działania skryptu webpacka. Mogą dodawać pliki, usuwać je lub ponownie przetwarzać.
  • 40. Ekstrakcja CSS /uszanowanko/webpack> webpack Hash: 1d336bd3e0dba1633bcc Version: webpack 1.12.12 Time: 749ms Asset Size Chunks Chunk Names 44402ef52711a576ca7d32819295f64e.png 188 kB [emitted] 5e8e95d00a8673e044ce5ae85a86d22f.png 134 kB [emitted] cat-bundle.js 4.02 kB 0 [emitted] cat 1.1-bundle.js 268 kB 1 [emitted] dog-bundle.js 2.15 kB 2 [emitted] dog styles-cat.css 100 bytes 0 [emitted] cat [0] ./cat.js 151 bytes {0} [built] [0] ./dog.js 122 bytes {2} [built] [1] ./cat/head.js 224 bytes {1} [built] [4] ./cat/body.js 99 bytes {1} [built] + 5 hidden modules Child extract-text-webpack-plugin: Asset Size Chunks Chunk Names 44402ef52711a576ca7d32819295f64e.png 188 kB [emitted] + 3 hidden modules
  • 42. Wspólne fragmenty kodu uszanowanko = require('./common/uszanowanko'); uszanowanko(); //... uszanowanko = require('./common/uszanowanko'); uszanowanko(); //... assets/dog.js assets/cat.js $ = require('jquery'); wow = function(){ $('body').prepend('<h2>Uszanowanko, wow!</h2>'); }; module.exports = wow; assets/common/uszanowanko.js dog.jscat.js uszanowanko.js
  • 43. Wspólne fragmenty kodu var webpack = require('webpack'); module.exports = { //... plugins: [ new webpack.optimize.CommonsChunkPlugin({ name: 'common', filename: 'common.js', chunks: ['dog', 'cat'] }), //... ] }; webpack.config.js
  • 45. Wspólne fragmenty kodu /uszanowanko/webpack> webpack Hash: 644d6d78fe56c9b09505 Version: webpack 1.12.12 Time: 748ms Asset Size Chunks Chunk Names 44402ef52711a576ca7d32819295f64e.png 188 kB [emitted] 5e8e95d00a8673e044ce5ae85a86d22f.png 134 kB [emitted] cat-bundle.js 605 bytes 0 [emitted] cat 1.1-bundle.js 1.21 kB 1 [emitted] dog-bundle.js 879 bytes 2 [emitted] dog common.js 271 kB 3 [emitted] common styles-cat.css 100 bytes 0 [emitted] cat [0] ./cat.js 225 bytes {0} [built] [0] ./dog.js 186 bytes {2} [built] [1] ./common/uszanowanko.js 128 bytes {3} [built] [3] ./cat/head.js 224 bytes {1} [built] [5] ./cat/body.js 99 bytes {1} [built] + 5 hidden modules Child extract-text-webpack-plugin: Asset Size Chunks Chunk Names 44402ef52711a576ca7d32819295f64e.png 188 kB [emitted] + 3 hidden modules
  • 46. Wspólne fragmenty kodu /uszanowanko/webpack> webpack Hash: 644d6d78fe56c9b09505 Version: webpack 1.12.12 Time: 748ms Asset Size Chunks Chunk Names 44402ef52711a576ca7d32819295f64e.png 188 kB [emitted] 5e8e95d00a8673e044ce5ae85a86d22f.png 134 kB [emitted] cat-bundle.js 605 bytes 0 [emitted] cat 1.1-bundle.js 1.21 kB 1 [emitted] dog-bundle.js 879 bytes 2 [emitted] dog common.js 271 kB 3 [emitted] common styles-cat.css 100 bytes 0 [emitted] cat [0] ./cat.js 225 bytes {0} [built] [0] ./dog.js 186 bytes {2} [built] [1] ./common/uszanowanko.js 128 bytes {3} [built] [3] ./cat/head.js 224 bytes {1} [built] [5] ./cat/body.js 99 bytes {1} [built] + 5 hidden modules Child extract-text-webpack-plugin: Asset Size Chunks Chunk Names 44402ef52711a576ca7d32819295f64e.png 188 kB [emitted] + 3 hidden modules /uszanowanko/webpack> webpack Hash: 1d336bd3e0dba1633bcc Version: webpack 1.12.12 Time: 749ms Asset Size Chunks Chunk Names 44402ef52711a576ca7d32819295f64e.png 188 kB [emitted] 5e8e95d00a8673e044ce5ae85a86d22f.png 134 kB [emitted] cat-bundle.js 4.02 kB 0 [emitted] cat 1.1-bundle.js 268 kB 1 [emitted] dog-bundle.js 2.15 kB 2 [emitted] dog styles-cat.css 100 bytes 0 [emitted] cat [0] ./cat.js 151 bytes {0} [built] [0] ./dog.js 122 bytes {2} [built] [1] ./cat/head.js 224 bytes {1} [built] [4] ./cat/body.js 99 bytes {1} [built] + 5 hidden modules Child extract-text-webpack-plugin: Asset Size Chunks Chunk Names 44402ef52711a576ca7d32819295f64e.png 188 kB [emitted] + 3 hidden modules
  • 47. Wspólne fragmenty kodu /uszanowanko/webpack> webpack Hash: 644d6d78fe56c9b09505 Version: webpack 1.12.12 Time: 748ms Asset Size Chunks Chunk Names 44402ef52711a576ca7d32819295f64e.png 188 kB [emitted] 5e8e95d00a8673e044ce5ae85a86d22f.png 134 kB [emitted] cat-bundle.js 605 bytes 0 [emitted] cat 1.1-bundle.js 1.21 kB 1 [emitted] dog-bundle.js 879 bytes 2 [emitted] dog common.js 271 kB 3 [emitted] common styles-cat.css 100 bytes 0 [emitted] cat [0] ./cat.js 225 bytes {0} [built] [0] ./dog.js 186 bytes {2} [built] [1] ./common/uszanowanko.js 128 bytes {3} [built] [3] ./cat/head.js 224 bytes {1} [built] [5] ./cat/body.js 99 bytes {1} [built] + 5 hidden modules Child extract-text-webpack-plugin: Asset Size Chunks Chunk Names 44402ef52711a576ca7d32819295f64e.png 188 kB [emitted] + 3 hidden modules
  • 48. Inne ciekawe wtyczki - UglifyJsPlugin - używa biblioteki UglifyJS by zmniejszyć rozmiar plików - DedupePlugin - wyszukuje zduplikowane pliki i je łączy - ProvidePlugin - automatycznie importuje moduły na podstawie zmiennych - CleanupPlugin - czyści folder na kompilowane pliki przed emisją nowych - AssetsPlugin - zrzuca do pliku JSON informacje o wyemitowanych plikach, które należy dołączyć do dokumentu HTML
  • 49. Inne ciekawe wtyczki - UglifyJsPlugin - używa biblioteki UglifyJS by zmniejszyć rozmiar plików - DedupePlugin - wyszukuje zduplikowane pliki i je łączy - ProvidePlugin - automatycznie importuje moduły na podstawie zmiennych - CleanupPlugin - czyści folder na kompilowane pliki przed emisją nowych - AssetsPlugin - zrzuca do pliku JSON informacje o wyemitowanych plikach, które należy dołączyć do dokumentu HTML { "cat": { "js": "compiled/cat-bundle.js", "css": "compiled/styles-cat.css" }, "dog": { "js": "compiled/dog-bundle.js" }, "common": { "js": "compiled/common.js" } }
  • 50. Krok ostatni Inne dodatki i ustawienia module.exports = { //... devtool: 'source-map' };
  • 51. Krok ostatni Inne dodatki i ustawienia module.exports = { //... devtool: 'source-map' };
  • 52. Krok ostatni Inne dodatki i ustawienia module.exports = { //... devtool: 'source-map' };
  • 53. Krok ostatni Inne dodatki i ustawienia module.exports = { //... devtool: 'source-map' };
  • 55. Tryb watch /uszanowanko/webpack> webpack --watch --progress Hash: 644d6d78fe56c9b09505 Version: webpack 1.12.12 Time: 748ms Asset Size Chunks Chunk Names 44402ef52711a576ca7d32819295f64e.png 188 kB [emitted] 5e8e95d00a8673e044ce5ae85a86d22f.png 134 kB [emitted] cat-bundle.js 605 bytes 0 [emitted] cat 1.1-bundle.js 1.21 kB 1 [emitted] dog-bundle.js 879 bytes 2 [emitted] dog common.js 271 kB 3 [emitted] common styles-cat.css 100 bytes 0 [emitted] cat [0] ./cat.js 225 bytes {0} [built] [0] ./dog.js 186 bytes {2} [built] [1] ./common/uszanowanko.js 128 bytes {3} [built] [3] ./cat/head.js 224 bytes {1} [built] [5] ./cat/body.js 99 bytes {1} [built] + 5 hidden modules Child extract-text-webpack-plugin: Asset Size Chunks Chunk Names 44402ef52711a576ca7d32819295f64e.png 188 kB [ emitted] + 3 hidden modules
  • 56. Tryb watch common.js 271 kB 3 [emitted] common styles-cat.css 100 bytes 0 [emitted] cat [0] ./cat.js 225 bytes {0} [built] [0] ./dog.js 186 bytes {2} [built] [1] ./common/uszanowanko.js 128 bytes {3} [built] [3] ./cat/head.js 224 bytes {1} [built] [5] ./cat/body.js 99 bytes {1} [built] + 5 hidden modules Child extract-text-webpack-plugin: Asset Size Chunks Chunk Names 44402ef52711a576ca7d32819295f64e.png 188 kB [emitted] + 3 hidden modules Hash: 23ce8cce5f54a398b346 Version: webpack 1.12.12 Time: 13ms Asset Size Chunks Chunk Names cat-bundle.js 620 bytes 0 [emitted] cat styles-cat.css 142 bytes 0 [emitted] cat cat-bundle.js.map 507 bytes 0 [emitted] cat styles-cat.css.map 91 bytes 0 [emitted] cat [0] ./cat.js 201 bytes {0} [built] + 9 hidden modules
  • 57. Serwer developerski npm install webpack-dev-server -g webpack-dev-server --content-base . // http://localhost:8080/cat.html
  • 58. Serwer developerski - autorealod // Poprzez iframe ---> // http://localhost:8080/webpack-dev-server/cat.html webpack-dev-server // Standardowe // http://localhost:8080/cat.html webpack-dev-server --inline
  • 59. Hot module reload webpack-dev-server --inline --hot if(module.hot) { module.hot.accept("./common/uszanowanko" , function() { var uszanowanko = require('./common/uszanowanko' ); var $ = require('jquery'); $('h2').remove(); uszanowanko(); }); }
  • 60. Podsumowanie Dlaczego chcesz używać webpacka? - Potrzebujesz skalowalności w projekcie - Masz duży projekt z dużą ilością wspólnych zależności - Chcesz łatwo skonfigurować transpilację - Lubisz porządek w zależnościach - Nie lubisz zmiennych globalnych A dlaczego nie chcesz? - Masz istniejący projekt, który będzie trzeba migrować - Bo naprawdę potrzebujesz task-runnera, a nie bundlera ;)