webpack

Implementing Webpack from Scratch, But in Rust – [3] Using NAPI-RS to Create Node.js Addons

Implementing Webpack from Scratch, But in Rust – [3] Using NAPI-RS to Create Node.js Addons

Referencing mini-webpack, I implemented a simple webpack from scratch using Rust. This allowed me to gain a deeper understanding of webpack and also improve my Rust skills. It's a win-win situation! Code repository: https://github.com/ParadeTo/rs-webpack This article corresponds to the Pull Request: https://github.com/ParadeTo/rs-webpack/pull/4 The title seems unrelated to this series, as implementing webpack with Rust involves Node.js plugin development. But don't worry, let me explain. When we use webpack for bundling, don't we often run the following command? webpack --config webpack.config.js Enter fullscreen mode Exit fullscreen mode Similarly, we want our RS Webpack to support such a command. But how can…
Read More
webpack publicpath

webpack publicpath

The publicPath configuration option acts as a placeholder, allowing you to dynamically adjust the paths to your static assets. To illustrate, let's consider the scenario where you've uploaded your static assets, such as commons.js to a CDN. The actual URL for this file might be: https://s1.cdn.com/my-project/commons.js However, your HTML page is typically served from your own domain, for example:https://my-own-domain.com/my-project/index.html To ensure that the index.html correctly references the CDN-hosted static files, you can utilize the publicPath setting. This configuration will replace the local path of commons.js within index.html from: https://my-own-domain.com/my-project/commons.jsto the CDN path: https://s1.cdn.com/my-project/commons.jsBy setting the publicPath, you ensure that all…
Read More
No widgets found. Go to Widget page and add the widget in Offcanvas Sidebar Widget Area.