Hi,
I’m trying to build React App using Okta SignIn Widget, and instead of using “create-react-app”, I’m trying to create webpack.config.js by myself:
// Import webpack module
var webpack = require(‘webpack’)
// Import open browser plugin
var OpenBrowserPlugin = require(‘open-browser-webpack-plugin’)
//Import path module
const path = require(‘path’)
module.exports = {
entry: ‘./src/index.js’, //set entry file
// Resolve to output directory and set file
output: {
path: path.resolve(‘dist/assets’),
filename: ‘bundle.js’,
publicPath: ‘assets’
},
// Add Url param to open browser plugin
plugins: [new OpenBrowserPlugin({url: ‘http://localhost:3000’})],
// Set dev-server configuration
devServer: {
inline: true,
contentBase: ‘./dist’,
historyApiFallback: true,
port: 3000
},
// Add babel-loader to transpile js and jsx files
module: {
rules: [
{
test: /.(js|jsx)/,
exclude: /node_modules/,
use: {
loader: 'babel-loader'
}
},
{
test: /\.css/,
use: [‘style-loader’, ‘css-loader’]
},
{
test: /.(png|jpg|gif|ttf|woff|eot|svg)$/,
use: [
{
loader: ‘file-loader’,
options: {}
}
]
}
]
}
}
But, my app caught “regenerationRuntime is not defined” error in the browser:
Uncaught ReferenceError: regeneratorRuntime is not defined
at eval (webpack:///./src/components/auth/Login.js?:62)
at eval (webpack:///./src/components/auth/Login.js?:91)
at eval (webpack:///./src/components/auth/Login.js?:131)
at Module…/src/components/auth/Login.js (bundle.js:11546)
at webpack_require (bundle.js:725)
at fn (bundle.js:102)
at eval (webpack:///./src/App.js?:11)
at Module…/src/App.js (bundle.js:11438)
at webpack_require (bundle.js:725)
at fn (bundle.js:102)
Is there any instruction to build React App with Okta SignIn Widget using Webpack?
Thanks in advance!
Jian