project uses the vue cli3 scaffolding tool to build
as shown in the element official documentation.
npm install babel-plugin-component-D
then add the .babelrc file
{
"presets": [
["es2015", {
"modules": false
}]
],
"plugins": [
[
"component",
{
"libraryName": "element-ui",
"styleLibraryName": "theme-chalk"
}
]
]
}
the startup project found that babel-preset-es2015 was missing, so cnpm install-- save babel-preset-es2015 installed
and then the startup project reported an error
Error: Plugin/Preset files are not allowed to export objects, only functions.. In E:vue3-confignode_modulesbabel-preset-es2015libindex.js
novice Xiaobai asks for online solutions