Currently, I am facing an issue with my MVC application while trying to integrate Bootstrap 5 using Webpack. Despite attempting various workarounds with stage-0, stage-2, and stage-3, none have proven successful for me.
I suspect that the problem lies with the spread syntax (three dots), but even after applying the workaround, the issue persists.
Error Message:
ERROR in ./~/bootstrap/dist/js/bootstrap.esm.js
Module parse failed: C:\DO NOT DELETE\Projects\GIT_SourceCode\Brain.Web\node_modules\bootstrap\dist\js\bootstrap.esm.js
Unexpected token (1242:15)
You may need an appropriate loader to handle this file type.
|
| _getConfig(config) {
| config = { ...Default$a,
| ...Manipulator.getDataAttributes(this._element),
| ...(typeof config === 'object' ? config : {})
@ ./Content/js/site.js 5:0-19
ERROR in site-30927619780d53073ccb.min.js from UglifyJs
Unexpected token: name (BSTChart) [site-30927619780d53073ccb.min.js:107816,6]
ERROR in report-30927619780d53073ccb.min.js from UglifyJs
Unexpected token: name (BSTChart) [report-30927619780d53073ccb.min.js:106016,6]
Package.json
{
"dependencies": {
"inputmask": "^3.3.10"
},
"devDependencies": {
// List of dependencies here...
},
"license": "MIT",
"main": "index.js",
"name": "brain",
"scripts": {
"build": "webpack",
"build-prod": "webpack --config ./webpack.prod.config.js"
},
"version": "1.0.0"
}
webpack.config.js
const path = require('path');
// Rest of the webpack configuration