We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
System: OS: Windows 10 10.0.19045 CPU: (12) x64 12th Gen Intel(R) Core(TM) i5-12400 Memory: 14.81 GB / 31.78 GB Browsers: Edge: Chromium (126.0.2592.81) Internet Explorer: 11.0.19041.4355 npmPackages: @rsbuild/core: ^0.7.9 => 0.7.9 @rsbuild/plugin-babel: ^0.7.9 => 0.7.9 @rsbuild/plugin-node-polyfill: ^0.7.10 => 0.7.10 @rsbuild/plugin-sass: ^0.7.9 => 0.7.9 @rsbuild/plugin-vue2: ^0.7.9 => 0.7.9 @rsbuild/plugin-vue2-jsx: ^0.7.9 => 0.7.9
none
import { defineConfig, loadEnv } from '@rsbuild/core'; // vue 插件 import { pluginVue2 } from '@rsbuild/plugin-vue2'; import { pluginBabel } from '@rsbuild/plugin-babel'; import { pluginVue2Jsx } from '@rsbuild/plugin-vue2-jsx'; import { pluginNodePolyfill } from '@rsbuild/plugin-node-polyfill'; import { pluginSass } from '@rsbuild/plugin-sass'; import dayjs from 'dayjs'; import path from 'node:path'; // process.env.VUE_APP_VERSION = require('./package.json').version; process.env.VUE_APP_BUILD_TIME = dayjs().format('YYYY-M-D HH:mm:ss'); // 适配 vue-cli 中的变量 const { publicVars } = loadEnv({ prefixes: ['VUE_APP_'] }); // 适配别名配置 const aliasOptions = { '@': path.resolve(__dirname, './src'), 'worker-loader': require.resolve('worker-rspack-loader'), }; const sourceOptions = { define: publicVars, alias: aliasOptions, }; // html 插件适配 const htmlOptions = { template: './public/index.html', // templateParameters: { // 生产环境里面的cdn cdn: { css: [], js: [], }, }, }; console.log(`web_当前版本: -> ${process.env.VUE_APP_VERSION} <-`) console.log(`是否是mock: -> ${process.env.VUE_APP_BUILD_MODE === 'true' ? '是' : '否'} <-`) console.log(`web_请求后台_url_地址: -> ${process.env.VUE_APP_PUBLIC_PATH} <-\n`) export default defineConfig({ // source适配 source: sourceOptions, // resolve: { alias: aliasOptions, }, // html适配 html: htmlOptions, // 各种 webpack 插件 plugins: [ pluginBabel({ include: /\.(?:jsx|tsx)$/, exclude: /[\\/]node_modules[\\/]/, }), pluginVue2Jsx({ vueJsxOptions: { compositionAPI: true } }), pluginVue2(), pluginSass({ sassLoaderOptions: { api: 'legacy', additionalData: `@import '~@/assets/style/public.scss';`, }, }), pluginNodePolyfill() ], // server: { proxy: { // ... } } });
The text was updated successfully, but these errors were encountered:
Sorry, something went wrong.
Thanks for report.
// index.js if (false) { const hasConsole = typeof console === 'undefined'; }
// rspack.config.js module.exports = { mode: "none", devtool: false, entry: './src/index.js'. optimization: { innerGraph: true, } };
/******/ (() => { // webpackBootstrap var __webpack_exports__ = {}; if (false) {} /******/ })() ;
(() => { // webpackBootstrap var __webpack_exports__ = {}; if (false) {}(/* unused pure expression or super */ null && ()) })() ;
Transfered to Rspack repo
Successfully merging a pull request may close this issue.
Version
Details
The development model is normal, but I reported an error when I pack it ... but it seems that the packaging has been completed
Reproduce link
none
Reproduce Steps
The text was updated successfully, but these errors were encountered: