Angular Universal with i18n (Server Side Rendering)

A solution is to pre-build packages for each language, and have a proxy detect which bundle to serve as default. From the Angular docs on i8n: Merge with the AOT compiler The AOT (Ahead-of-Time) compiler is part of a build process that produces a small, fast, ready-to-run application package. When you internationalize with the AOT … Read more

How to correctly build NestJS app for production with node_modules dependencies in bundle?

Out of the box, nest cli does not support including the node_modules dependencies into the dist bundle. However, there are some community examples of custom webpack configs that include the dependencies in the bundle, e.g. bundled-nest. As described in this issue, it is necessary to include the webpack.IgnorePlugin to whitelist unused dynamic libraries.

What is exactly the importLoaders option of css-loader in Webpack 4?

After more searching it turned out that I’m not the only one confused about how to use this option correctly. Issues from the GitHub repo of css-loader: https://github.com/webpack-contrib/css-loader/issues/765 Also see @guidobouman excellent explanation here: https://github.com/webpack-contrib/css-loader/issues/228#issuecomment-312885975 So this answers my question (quoted literally): importLoaders only has effect on unresolved @imports. So when using postCSS with nextCSS … Read more

Webpack: What is the difference between “all” and “initial” options in optimization.splitChunks.chunks

Trying for the simplest explanation. This is the file that will be transpiled and bundled: //app.js import “my-static-module”; if(some_condition_is_true){ import (“my-dynamic-module”) } console.log(“My app is running”) Now see how different optimization types will treat it. async (default): Two files will be created. bundle.js (includes app.js + my-static-module) chunk.js (includes my-dynamic-module only) initial: Three files will … Read more

Incompatible units: ‘rem’ and ‘px’ – Bootstrap 4 and Laravel Mix

Solved remove the bootstrap entry from package.json and replace it with “bootstrap”: “4.0.0-alpha.6”, in resources/assets/sass/app.scss, comment out the import of variables. change the path of bootstrap to @import “node_modules/bootstrap/scss/bootstrap.scss”; in resources/assets/js/bootstrap.js, look for require(‘bootsrap-sass’); and change it to require(‘bootstrap’); Link!

Webpack 4: mini-css-extract-plugin + sass-loader + splitChunks

im doing someting like this in my Webpack 4 configuration. const MiniCssExtractPlugin = require(“mini-css-extract-plugin”) module: { rules: [ { test: /\.scss$/, use: [ MiniCssExtractPlugin.loader, { loader: “css-loader”, options: { modules: true, sourceMap: true, importLoader: 2 } }, “sass-loader” ]} ] }, plugins: [ new MiniCssExtractPlugin({ // Options similar to the same options in webpackOptions.output // … Read more

How to resolve aliases in Storybook?

Just add this in your .storybook/main.js const path = require(‘path’); module.exports = { “stories”: [ “../components/**/*.stories.mdx”, “../components/**/*.stories.@(js|jsx|ts|tsx)” ], “addons”: [ “@storybook/addon-links”, “@storybook/addon-essentials”, ‘@storybook/preset-scss’, ], webpackFinal: async (config) => { config.resolve.alias = { …config.resolve.alias, ‘@/interfaces’: path.resolve(__dirname, “../interfaces”), }; return config; } } here interface is folder at my project root It works For Me

tech