-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rollup #109
Comments
打包 async-await配置 export default {
input: 'index.js',
external: ['axios'],
plugins: [
require('rollup-plugin-node-resolve')(),
require('rollup-plugin-commonjs')(),
require('rollup-plugin-buble')(),
require('rollup-plugin-replace')({
'process.env.NODE_ENV': `'development'`,
'process.env.BUILD': `'test'`,
}),
// require('rollup-plugin-async')(),
// require('rollup-plugin-regenerator')({
// includeRuntime: false
// }),
],
output: { file: 'dist/test.cjs.js', format: 'cjs' }
} 文件 'use strict';
require('axios');
var lib = async function name(params) {
return
};
var fn = function (ref) {
var x = ref.x;
var y = ref.y;
console.log(x, y);
};
lib.fn = fn;
var demo1 = lib;
module.exports = demo1;
rollup-plugin-regenerator
使用 nodent , 打开 promise, 编译出的代码需要 Promise 全局变量, 但是可读性强多了
|
output -> commonjssource module.exports = blabla
module.exports.x = y output exports.default = blabla
exports.x = y 配合 babel 的 import 刚好 babel-source import x from 'x'
x.y() babel output 'use strict';
var _x = require('x');
var _x2 = _interopRequireDefault(_x);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
_x2.default.y();
|
Plugins
|
TypeScript
|
Rollup Plugin DevHooks |
Links
The text was updated successfully, but these errors were encountered: