我收到错误“无法从...找到模块'@babel/plugin-transform-runtime'”。我已经尝试了互联网上的所有解决方案,但没有真正有效。我该如何解决?任何建议将大大appriciated。
巴别尔
{
"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"
}]
]}
Run Code Online (Sandbox Code Playgroud)
网络包
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'
})
}
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
11670 次 |
最近记录: |