【Vue】使用Rollup打包vue时出现process is not defined
来源:互联网 发布:简单的视频制作软件 编辑:程序博客网 时间:2024/06/05 11:01
解决办法,使用插件rollup-plugin-replace
代码如下:
import babel from 'rollup-plugin-babel';import resolve from 'rollup-plugin-node-resolve';import vue from 'rollup-plugin-vue';import replace from 'rollup-plugin-replace'export default { entry: 'src/main.js', format: 'cjs', plugins: [ vue(), replace({ 'process.env.NODE_ENV': JSON.stringify('development'), 'process.env.VUE_ENV': JSON.stringify('browser') }), resolve(), babel() ], dest: 'dist/bundle.js' // 输出文件};
0 0
- 【Vue】使用Rollup打包vue时出现process is not defined
- 使用Vue的时候出现 $index is not defined
- Vue中引入Countly,'Countly' is not defined
- Vue+Webpack引入Jquery第三方插件,jQuery is not defined 错误,解决方案
- VUE.JS v-for渲染过程中 $index is not defined
- Vue+Webpack引入Jquery第三方插件,jQuery is not defined 错误,解决方案
- vue expose-loader 引入jQuery Error in created hook: "ReferenceError: $ is not defined"
- Vue报错笔记(1)vue.js:515 [Vue warn]: Property or method "name" is not defined on the instance but refere
- beatPicker使用出现Uncaught ReferenceError: module is not defined
- 使用python经常出现NameError: name 'xxx' is not defined
- 使用vue时Module build failed: TypeError: this._init is not a function错误的解决方法
- 使用webpack打包Vue工程
- 使用webpack打包vue工程
- 调试WEB程序时出现$ is not defined
- Vue列表渲染指令v-for的索引$index报错Uncaught ReferenceError: $index is not defined
- 运行gem5报错 NameError: name 'process' is not defined
- vue.js使用vue-cli打包遇到的坑,问题
- ISE10.1中复数乘法器IP核使用ModelSim仿真时出现“Module 'CMPY_V2_1' is not defined.”错误的解决方法
- leetcode 21. Merge Two Sorted Lists Add to List
- Quartz简介
- Response.Write和ClientScript.RegisterStartupScript区别
- the source attachment does not contain the source for the file xxx.class无法关联到某个类
- BZOJ 1011: [HNOI2008]遥远的行星
- 【Vue】使用Rollup打包vue时出现process is not defined
- jsonp解决ajax跨域问题
- 自动将千以内的含4的数加一,其他不变。
- CentOS 6.2编译安装Nginx1.2.0+MySQL5.5.25+PHP5.3.13+博客系统WordPress3.3.2
- VS 2008 使用静态库的时候报错
- MFC中窗口刷新函数详解
- VMware中ubuntu忘记密码解决办法
- lesson6.6Hashtable使用
- LeetCode #17 Letter Combinations of a Phone Number