I have a simple Vue.js application which works perfectly on other browsers than IE, which shows a blank page with an error SCRIPT1003: Expected ':'
. I have added a vue.config.js
file which looks like that:
module.exports = {
transpileDependencies: ["bootstrap-css-only", "mdbvue"]
};
My .babelrc
file is a default one taken from the official project starting page, this is:
{
"presets": [
[
"env",
{
"modules": false,
"targets": {
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
}
}
],
"stage-2"
],
"plugins": ["transform-vue-jsx", "transform-runtime"]
}
In my main.js
file I tried 2 approaches:
import "core-js/stable";
import "regenerator-runtime/runtime";
and
import "@babel/polyfill";
Both didn't change anything and the error and behaviour is the same. The only one thing which still comes to my mind to solve this problem is mentioned here, i.e. in export default
I'm using the following syntax for component:
components: {
mdbContainer,
mdbRow,
mdbCol,
mdbCard,
mdbCardBody,
mdbInput,
mdbBtn,
mdbIcon,
mdbModalFooter,
mdbView
}
Edit2: But if I'll drop this lines then all my UI elements from MDBootstrap are gone. Is there any other way to use it? I wanted simply to use polyfills.
I tried to create babel.config.js
file, but also didn't help. The logic in this file is like that:
module.exports = {
presets: [["@vue/app", { useBuiltIns: "entry" }]]
};
Is there anything I'm missing? What I understood the vue.config.js
file doesn't has to be imported anywhere, because vue.config.js
is an optional config file that will be automatically loaded by @vue/cli-service
. Here are my questions:
- Any ideas what can be wrong?
- Shall I have
babel.config.js
and.babelrc
or only one of these? - Is
babel.config.js
file automatically detected likevue.config.js
? - [Edit] Maybe something in webpack configuration should be changed?
Vue CLI version:
$ vue --version
3.11.0