Я получаю сообщение об ошибке "Не удается найти модуль '@ babel / plugin-transform-runtime' from ...". Я перепробовал каждое решение на inte rnet, но на самом деле ничего не работает. Как я могу решить это? Любое предложение будет очень ценным.
babelr c
{
"presets": [
"@babel/preset-react",
"@babel/preset-env"
],
"plugins": [
["transform-runtime", {
"helpers": false, // defaults to true
"polyfill": false, // defaults to true
"regenerator": true, // defaults to true
"moduleName": "babel-runtime" // defaults to "babel-runtime"
}]
]}
webpack
var HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');
module.exports = {
mode: 'development',
resolve: {
extensions: ['.js', '.jsx', '.css']
},
module: {
rules: [
{
test: /\.jsx?$/,
loader: 'babel-loader'
},
{
test: /\.css$/,
use: [ 'style-loader', 'css-loader' ]
}
]
},
resolve: {
extensions: ['.js', '.jsx', '.css'],
alias: {
'@': path.resolve(__dirname, 'src/'),
}
},
plugins: [new HtmlWebpackPlugin({
template: './src/index.html'
})],
devServer: {
historyApiFallback: true
},
externals: {
// global app config object
config: JSON.stringify({
apiUrl: 'https://obidentity-develop.azurewebsites.net/connect/token'
})
}
}