Winnetou Bundle Releaser - WBR
The creation of the bundle is very easy and is done through the babel and webpack. You just need to determine the entry and the out in win.config.json.
You can set more than one app to be compiled at same time.
...
apps:[{
entry: "./js/themesApp.js",
out: "./releaseThemesApp"
}],
...
and run
node wbr --bundleRelease
and the bundle release will be in "./releaseThemesApp/winnetouBundle.min.js" with the source map and lazy modules too.
Production Mode
WBR will compile in dev mode allowing you debug your code in devtools with mapping. To reduce bundle size and obfuscate the output, run with --production flag: node wbr --bundleRelease --production
.
WBR Arguments
Click here to go to api and learn more about wbr.
In Deep Projects
If you are working with deep project folders and calls js files in up folders, add this dev dependencies to you main package.json on the project root, otherwise you may get some webpack errors:
"devDependencies": {
"@babel/core": "^7.24.5",
"@babel/eslint-parser": "^7.24.5",
"@babel/plugin-transform-nullish-coalescing-operator": "^7.24.1",
"@babel/plugin-transform-optional-chaining": "^7.24.5",
"@babel/plugin-transform-runtime": "^7.24.3",
"@babel/preset-env": "^7.24.5",
"@babel/runtime": "^7.24.5",
"babel-loader": "^9.1.3",
"webpack": "^5.2.0"
}