-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
14 additions
and
29 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,10 @@ | ||
module.exports = {presets: ["@vue/cli-plugin-babel/preset"]} | ||
// 这是项目发布阶段需要用到的babel插件 | ||
const prodPlugins = []; | ||
// 如果是发布阶段,处于生产环境,就向prodPlugins数组里添加一个插件 | ||
if (process.env.NODE_ENV === "production") { | ||
prodPlugins.push("transform-remove-console"); | ||
} | ||
module.exports = { | ||
presets: ["@vue/cli-plugin-babel/preset"], | ||
plugins: [...prodPlugins] // 这里...展开运算符,把上面定义的prodPlugins数组里面的每一项展开添加到这个plugins数组里面 | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters