#Docker + Webpack - Sii course
##Modules in JS Separate scopes in modules (e.g. functions) - IIFE to secure scopes and immediately invoke. We return what we want from our module. We don't need ES6, it could be done with IIFE.
We can use also AMD (Asynchronous Module Definition) define(['property1', 'property2'], function($, ) { ... })
We can use module.exports
and import
.
We can use UMD with AMD function. Universal Module Definition.
In ES6 we can use import / export / export default (new syntax)
- Compiler + Dependency Graph
- Resolver (listens events inside Webpack, search for files from entry point)
- Module Factory (creates module wrapped with filename, other code from Resolver etc.)
- Parser (creates ready code, injects dependencies)
- Template (creates functions readable for Webpack)
- Define own plugin:
new webpack.DefinePlugin({ ... })
in webpack.config.js - webpack-visualizer-plugin - to analyze bundle, like bundle-analyzer. Renders nice chart: file:///C:/Users/HP.TABLET-IKEJ8LMC/Documents/DEV/DockerWebpackSii/dist/stats.html
- complete OS on your host (multiple OS possible)
- heavy resources consuming
- only a kernel of OS on your host - much faster and less resources consuming
to stop:
docker stop CONTAINER-ID