mirror of
https://github.com/pezkuwichain/pezkuwi-ui.git
synced 2026-04-22 09:07:56 +00:00
Add webpack 5 support (#557)
* Add webpack 5 support * Update packages/example-react/webpack.config.js * lint * Update yarn.lock Co-authored-by: Jaco <jacogr@gmail.com>
This commit is contained in:
@@ -2,13 +2,13 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
const path = require('path');
|
||||
|
||||
const webpack = require('webpack');
|
||||
const ENV = process.env.NODE_ENV || 'development';
|
||||
const isProd = ENV === 'production';
|
||||
|
||||
module.exports = {
|
||||
context: __dirname,
|
||||
devtool: isProd ? 'source-map' : 'cheap-eval-source-map',
|
||||
devtool: isProd ? 'source-map' : 'eval-cheap-source-map',
|
||||
entry: './src/Demo.tsx',
|
||||
mode: ENV,
|
||||
module: {
|
||||
@@ -26,11 +26,19 @@ module.exports = {
|
||||
filename: './Demo.js',
|
||||
path: path.join(__dirname, 'build')
|
||||
},
|
||||
plugins: [],
|
||||
plugins: [
|
||||
new webpack.ProvidePlugin({
|
||||
Buffer: ['buffer', 'Buffer']
|
||||
}),
|
||||
new webpack.ProvidePlugin({
|
||||
process: 'process/browser'
|
||||
})
|
||||
],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@polkadot/ui-settings': path.resolve(__dirname, '../ui-settings/build'),
|
||||
'@polkadot/ui-shared': path.resolve(__dirname, '../ui-shared/build')
|
||||
'@polkadot/ui-shared': path.resolve(__dirname, '../ui-shared/build'),
|
||||
'process/browser': require.resolve('process/browser')
|
||||
},
|
||||
extensions: ['.js', '.jsx', '.ts', '.tsx']
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user