diff --git a/.yarn/versions/5e5da9b4.yml b/.yarn/versions/5e5da9b4.yml new file mode 100644 index 00000000..f66bb983 --- /dev/null +++ b/.yarn/versions/5e5da9b4.yml @@ -0,0 +1,2 @@ +declined: + - helios diff --git a/scripts/webpack.config.cjs b/scripts/webpack.config.cjs index 4c177e29..41e36d73 100644 --- a/scripts/webpack.config.cjs +++ b/scripts/webpack.config.cjs @@ -2,9 +2,8 @@ const path = require('node:path') const MiniCssExtractPlugin = require('mini-css-extract-plugin') const HtmlWebpackPlugin = require('html-webpack-plugin') const CopyPlugin = require('copy-webpack-plugin') -const {ProvidePlugin} = require('webpack') +const {ProvidePlugin, DefinePlugin} = require('webpack') const {ProgressPlugin} = require('webpack') -const {EsbuildPlugin} = require('esbuild-loader') const packageJson = require('../package.json') const packagesPath = path.join(path.resolve(), './packages') const devMode = process.env.NODE_ENV !== 'production' @@ -110,11 +109,14 @@ const defaultConfig = { https: false, buffer: require.resolve('buffer/'), stream: require.resolve('stream-browserify'), - process: 'process/browser', + process: 'process/browser', }, alias: { '/images': path.join(packagesPath, 'browser-extension/images'), - "js-conflux-sdk": path.join(path.resolve(), './node_modules/js-conflux-sdk'), + 'js-conflux-sdk': path.join( + path.resolve(), + './node_modules/js-conflux-sdk', + ), }, }, plugins: [ @@ -123,18 +125,14 @@ const defaultConfig = { React: 'react', process: 'process/browser.js', }), - new EsbuildPlugin({ - define: { - 'process.env.NODE_DEBUG': JSON.stringify( - process.env.NODE_DEBUG || false, - ), - 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV), - 'process.env.CI': JSON.stringify(process.env.CI || false), - 'process.env.SENTRY_DSN': JSON.stringify( - process.env.SNOWPACK_PUBLIC_SENTRY_DSN || '', - ), - 'process.env.PACKAGE_VERSION': JSON.stringify(packageJson.version), - }, + new DefinePlugin({ + 'process.env.NODE_DEBUG': JSON.stringify(process.env.NODE_DEBUG || false), + 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV), + 'process.env.CI': JSON.stringify(process.env.CI || false), + 'process.env.SENTRY_DSN': JSON.stringify( + process.env.SNOWPACK_PUBLIC_SENTRY_DSN || '', + ), + 'process.env.PACKAGE_VERSION': JSON.stringify(packageJson.version), }), // Plugin to not generate js bundle for manifest entry new HtmlWebpackPlugin({