Using a full URL in a dynamic import()

ES2020 introduces a new function-like syntax for import, so-called “dynamic imports” permitting the dynamic import of JavaScript modules. The precise implementation of the importing process is left to the host (eg the browser, or Node.js), but modern web browsers do implement dynamic loading over HTTP using this syntax, with the module identified using a URL: … Read more

Webpack doesn’t resolve properly my alias

Resolving the alias to the absolute path should do the trick: resolve: { alias: { myApp: path.resolve(__dirname, ‘src’), }, extensions: [”, ‘.js’, ‘.jsx’] } Check this webpack resolve alias gist with a simple example. Another solution to limit the number of relative paths is to add your ./src folder as root instead of aliasing it: … Read more

DeprecationWarning: Compilation.assets will be frozen in future, all modifications are deprecated

Update 2021, Feb 25 Html-webpack-plugin v5 is released, just run npm i -D html-webpack-plugin@latest or npm uninstall html-webpack-plugin npm i -D html-webpack-plugin Original answer This is mostly related to html-webpack-plugin, and while its new version 5 (integrated with webpack v5) is still in beta, you should update it manually: npm show html-webpack-plugin version 4.5.1 npm … Read more

Webpack hmr: __webpack_hmr 404 not found

This line in entry array does not play well with webpack-dev-server: webpack-hot-middleware/client because it’s a requirement of webpack-hot-middleware for working with any server other than webpack-dev-server (such as express or some such). I ran into this mixed-server issue by following Webpack tutorials. They should update it so that the entry point for the config file … Read more

why do I have to put babel-presets inside .babelrc and webpack.config.js?

If I put presets inside webpack.config I should be able to delete .babelrc or vice verse. No, this is not the case. Specifying the presets in the webpack config will only affect webpack, everything else that uses babel (e.g. babel-node, babel-register, etc.) will not care about your webpack config and therefore doesn’t see them. The … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)