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:
Yuri
2021-12-13 06:29:38 +00:00
committed by GitHub
parent 8fbea71039
commit 6a515a1c53
7 changed files with 666 additions and 1455 deletions
+11 -3
View File
@@ -4,10 +4,11 @@
const path = require('path');
const VueLoaderPlugin = require('vue-loader/lib/plugin');
const { WebpackPluginServe } = require('webpack-plugin-serve');
const webpack = require('webpack');
module.exports = {
context: __dirname,
devtool: 'cheap-eval-source-map',
devtool: 'eval-cheap-source-map',
entry: './src/index.ts',
mode: 'development',
module: {
@@ -42,14 +43,21 @@ module.exports = {
progress: false, // since we have hmr off, disable
static: __dirname
}),
new VueLoaderPlugin()
new VueLoaderPlugin(),
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer']
}),
new webpack.ProvidePlugin({
process: 'process/browser'
})
],
resolve: {
alias: {
'@polkadot/ui-keyring': path.resolve(__dirname, '../ui-keyring/build'),
'@polkadot/ui-settings': path.resolve(__dirname, '../ui-settings/build'),
'@polkadot/ui-shared': path.resolve(__dirname, '../ui-shared/build'),
'@polkadot/vue-identicon': path.resolve(__dirname, '../vue-identicon/build')
'@polkadot/vue-identicon': path.resolve(__dirname, '../vue-identicon/build'),
'process/browser': require.resolve('process/browser')
},
extensions: ['.js', '.ts', '.tsx']
},