### Install and run http-server Source: https://github.com/symind/rspackify/blob/main/projects/webpack/README.md Commands to install the http-server utility globally and serve the contents of the dist directory. ```bash npm i -g http-server ``` ```bash cd dist && http-server ``` -------------------------------- ### Install project dependencies Source: https://github.com/symind/rspackify/blob/main/projects/webpack/README.md Run this command after cloning the repository to install all required packages. ```bash npm i ``` -------------------------------- ### Start development server Source: https://github.com/symind/rspackify/blob/main/projects/webpack/README.md Launches the webpack development server, typically accessible at localhost:8080. ```bash npm start ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/symind/rspackify/blob/main/projects/vue-cli/README.md Installs all project dependencies using pnpm. Run this after cloning a project or making changes to package.json. ```bash pnpm install ``` -------------------------------- ### Install Rspackify Globally Source: https://github.com/symind/rspackify/blob/main/README.md Install Rspackify globally to use the 'rspackify' command from your terminal. After installation, run 'rspackify' followed by your project's build command. ```bash npm install -g rspackify ``` -------------------------------- ### Dev Server Configuration Source: https://context7.com/symind/rspackify/llms.txt Example of configuring devServer options that Rspackify maps to the appropriate Rspack dev server version. ```javascript // webpack-dev-server v5.x projects use @rspack/dev-server (latest) // webpack-dev-server v4.x projects use @rspack/dev-server-v4 // Example webpack.config.js with dev server options module.exports = { // ... other config devServer: { static: { directory: path.join(__dirname, 'public'), }, compress: true, port: 3000, hot: true, open: true, }, }; // Works seamlessly with rspackify: // rspackify webpack serve --mode development ``` -------------------------------- ### Run Rspackify via CLI Source: https://context7.com/symind/rspackify/llms.txt Execute build commands using Rspackify either via npx or after global installation. ```bash # Using npx without installation npx rspackify npm run dev # After global installation npm install -g rspackify rspackify npm run build ``` -------------------------------- ### Configure package.json for Create React App Source: https://github.com/symind/rspackify/blob/main/README.md Update your package.json scripts to use Rspackify with Create React App for starting the development server and building the project. ```json { "scripts": { "start": "rspackify react-scripts start", "build": "rspackify react-scripts build" } } ``` -------------------------------- ### Run Rspackify with npx Source: https://github.com/symind/rspackify/blob/main/README.md Use this command to quickly run Rspackify without a global installation. Replace 'npm run dev' with your project's development or build command. ```bash npx rspackify npm run dev ``` -------------------------------- ### Configure package.json for Webpack CLI Source: https://github.com/symind/rspackify/blob/main/README.md Update your package.json scripts to use Rspackify with Webpack CLI for starting development servers and building projects. ```json { "scripts": { "start": "rspackify webpack serve", "build": "rspackify webpack" } } ``` -------------------------------- ### Run production build Source: https://github.com/symind/rspackify/blob/main/projects/webpack/README.md Compiles the project assets for production deployment. ```bash npm run build ``` -------------------------------- ### Build for Production Source: https://github.com/symind/rspackify/blob/main/projects/vue-cli/README.md Compiles and minifies the project for production deployment. Generates optimized static assets. ```bash pnpm run build ``` -------------------------------- ### Run Development Server Source: https://github.com/symind/rspackify/blob/main/projects/vue-cli/README.md Compiles and hot-reloads the project for development. Access your application via the provided local URL. ```bash pnpm run serve ``` -------------------------------- ### Enable Debug Mode and Configuration Reports Source: https://context7.com/symind/rspackify/llms.txt Set the DEBUG environment variable to generate an HTML diff report of the configuration transformation. ```bash # Enable debug mode with DEBUG environment variable DEBUG=rspackify npx rspackify npm run build # This generates rspackify-report.html in the current directory # The report shows a side-by-side diff of webpack vs rspack configurations ``` -------------------------------- ### Integrate Rspackify with Taro Source: https://context7.com/symind/rspackify/llms.txt Use the rspackify prefix for Taro mini-program build commands. ```json { "name": "my-taro-project", "scripts": { "build:weapp": "rspackify taro build --type weapp", "dev:weapp": "rspackify taro build --type weapp --watch" }, "dependencies": { "@tarojs/cli": "^3.6.0" } } ``` -------------------------------- ### Integrate Rspackify with Vue CLI Source: https://context7.com/symind/rspackify/llms.txt Wrap vue-cli-service commands to transition Vue projects to Rspack. ```json { "name": "my-vue-project", "scripts": { "serve": "rspackify vue-cli-service serve", "build": "rspackify vue-cli-service build", "lint": "vue-cli-service lint" }, "dependencies": { "vue": "^3.3.0" }, "devDependencies": { "@vue/cli-service": "^5.0.0" } } ``` -------------------------------- ### Integrate Rspackify with Create React App Source: https://context7.com/symind/rspackify/llms.txt Wrap react-scripts with Rspackify to accelerate CRA build processes. ```json { "name": "my-cra-project", "scripts": { "start": "rspackify react-scripts start", "build": "rspackify react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" }, "dependencies": { "react": "^18.2.0", "react-dom": "^18.2.0", "react-scripts": "5.0.1" } } ``` -------------------------------- ### Integrate Rspackify with UmiJS Source: https://context7.com/symind/rspackify/llms.txt Prefix umi commands to enable Rspack builds for UmiJS applications. ```json { "name": "my-umi-project", "scripts": { "dev": "rspackify umi dev", "build": "rspackify umi build", "postinstall": "umi setup" }, "dependencies": { "umi": "^4.0.0" } } ``` -------------------------------- ### Configure package.json for Taro (Weapp) Source: https://github.com/symind/rspackify/blob/main/README.md Update your package.json script to use Rspackify for building a Taro project targeting Weapp. ```json { "scripts": { "build:weapp": "rspackify taro build --type weapp" } } ``` -------------------------------- ### Environment Variable Configuration Source: https://context7.com/symind/rspackify/llms.txt Environment variables and CLI usage for controlling Rspackify behavior and debugging. ```bash # RSPACK_CONFIG_VALIDATE is set to 'loose' automatically # This prints configuration warnings but doesn't throw errors RSPACK_CONFIG_VALIDATE=loose # NODE_OPTIONS includes the module resolution hook NODE_OPTIONS="-r /path/to/cjs-resolve-hooks --no-warnings" # Example: Running with additional environment variables NODE_ENV=production rspackify npm run build # Debug mode for configuration analysis DEBUG=rspackify rspackify webpack build ``` -------------------------------- ### Integrate Rspackify with Webpack CLI Source: https://context7.com/symind/rspackify/llms.txt Prefix existing Webpack scripts in package.json to enable Rspack builds. ```json { "name": "my-webpack-project", "scripts": { "start": "rspackify webpack serve", "build": "rspackify webpack" }, "devDependencies": { "webpack": "^5.92.1", "webpack-cli": "^5.1.4", "webpack-dev-server": "^5.0.0" } } ``` -------------------------------- ### Webpack Configuration for Rspackify Source: https://context7.com/symind/rspackify/llms.txt Standard webpack configuration compatible with Rspackify, including loader and plugin definitions. ```javascript // Example webpack.config.js (unchanged, works with Rspackify) const path = require('path'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const CopyWebpackPlugin = require('copy-webpack-plugin'); module.exports = { entry: './src/index.js', output: { path: path.resolve(__dirname, 'dist'), filename: '[name].bundle.js', publicPath: '/', }, plugins: [ new CopyWebpackPlugin({ patterns: [ { from: 'public', to: 'assets', globOptions: { ignore: ['*.DS_Store'] }, noErrorOnMissing: true, }, ], }), new HtmlWebpackPlugin({ title: 'My App', template: './src/template.html', filename: 'index.html', }), ], module: { rules: [ // swc-loader is automatically transformed to builtin:swc-loader { test: /\.js$/, use: ['swc-loader'] }, { test: /\.(?:ico|gif|png|jpg|jpeg)$/i, type: 'asset/resource' }, { test: /\.(woff(2)?|eot|ttf|otf|svg|)$/, type: 'asset/inline' }, ], }, resolve: { extensions: ['.js', '.jsx', '.json'], alias: { '@': path.resolve(__dirname, 'src'), }, }, }; // Run with: rspackify webpack serve // Or: rspackify webpack build ``` -------------------------------- ### Configure package.json for UmiJS Source: https://github.com/symind/rspackify/blob/main/README.md Update your package.json scripts to use Rspackify with UmiJS for development and building. ```json { "scripts": { "serve": "rspackify umi dev", "build": "rspackify umi build" } } ``` -------------------------------- ### View Plugin Compatibility Mapping Source: https://context7.com/symind/rspackify/llms.txt Internal mapping logic used by Rspackify to redirect Webpack plugins to Rspack equivalents. ```javascript // Automatic plugin replacements handled by Rspackify: // copy-webpack-plugin → CopyRspackPlugin const CopyWebpackPlugin = require('copy-webpack-plugin'); // Internally redirected to: @rspack/core.CopyRspackPlugin // mini-css-extract-plugin → CssExtractRspackPlugin const MiniCssExtractPlugin = require('mini-css-extract-plugin'); // Internally redirected to: @rspack/core.CssExtractRspackPlugin // @pmmmwh/react-refresh-webpack-plugin → @rspack/plugin-react-refresh const ReactRefreshPlugin = require('@pmmmwh/react-refresh-webpack-plugin'); // Internally redirected to: @rspack/plugin-react-refresh // webpack-manifest-plugin → rspack-manifest-plugin const { WebpackManifestPlugin } = require('webpack-manifest-plugin'); // Internally redirected to: rspack-manifest-plugin // webpack-virtual-modules → rspack-plugin-virtual-module const VirtualModulesPlugin = require('webpack-virtual-modules'); // Internally redirected to: rspack-plugin-virtual-module // workbox-webpack-plugin → @aaroon/workbox-rspack-plugin const { GenerateSW, InjectManifest } = require('workbox-webpack-plugin'); // Internally redirected to: @aaroon/workbox-rspack-plugin ``` -------------------------------- ### Configure package.json for Vue CLI Source: https://github.com/symind/rspackify/blob/main/README.md Update your package.json scripts to use Rspackify with Vue CLI for serving and building Vue.js projects. ```json { "scripts": { "serve": "rspackify vue-cli-service serve", "build": "rspackify vue-cli-service build" } } ``` -------------------------------- ### Lint and Fix Files Source: https://github.com/symind/rspackify/blob/main/projects/vue-cli/README.md Lints and automatically fixes code style issues in your project files. Ensures code quality and consistency. ```bash pnpm run lint ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.