Commit d28fc4be authored by rockyl's avatar rockyl

删除tslib

parent 3c397938
...@@ -133,12 +133,12 @@ class CustomManager { ...@@ -133,12 +133,12 @@ class CustomManager {
this.pool.push(custom); this.pool.push(custom);
} }
generate(){ generate() {
let scripts = ''; let scripts = '';
for(let {id, code} of this.pool){ for (let {id, code} of this.pool) {
scripts += ` scripts += `
/*=====START ${id} START=====*/ /*=====START ${id} START=====*/
module = { var module = {
exports: {} exports: {}
}; };
(function(module){ (function(module){
...@@ -151,7 +151,14 @@ exports['${id}'] = module.exports; ...@@ -151,7 +151,14 @@ exports['${id}'] = module.exports;
return ` return `
(function(){ (function(){
var exports = {}; var exports = {};
var module;
function require(id){
if(id === 'tslib'){
return window['tslib']
}else{
console.log('missing require', id);
}
}
${scripts} ${scripts}
......
This diff is collapsed.
...@@ -139,12 +139,12 @@ class CustomManager { ...@@ -139,12 +139,12 @@ class CustomManager {
this.pool.push(custom); this.pool.push(custom);
} }
generate(){ generate() {
let scripts = ''; let scripts = '';
for(let {id, code} of this.pool){ for (let {id, code} of this.pool) {
scripts += ` scripts += `
/*=====START ${id} START=====*/ /*=====START ${id} START=====*/
module = { var module = {
exports: {} exports: {}
}; };
(function(module){ (function(module){
...@@ -157,7 +157,14 @@ exports['${id}'] = module.exports; ...@@ -157,7 +157,14 @@ exports['${id}'] = module.exports;
return ` return `
(function(){ (function(){
var exports = {}; var exports = {};
var module;
function require(id){
if(id === 'tslib'){
return window['tslib']
}else{
console.log('missing require', id);
}
}
${scripts} ${scripts}
......
This diff is collapsed.
...@@ -139,12 +139,12 @@ ${scripts} ...@@ -139,12 +139,12 @@ ${scripts}
this.pool.push(custom); this.pool.push(custom);
} }
generate(){ generate() {
let scripts = ''; let scripts = '';
for(let {id, code} of this.pool){ for (let {id, code} of this.pool) {
scripts += ` scripts += `
/*=====START ${id} START=====*/ /*=====START ${id} START=====*/
module = { var module = {
exports: {} exports: {}
}; };
(function(module){ (function(module){
...@@ -157,7 +157,14 @@ exports['${id}'] = module.exports; ...@@ -157,7 +157,14 @@ exports['${id}'] = module.exports;
return ` return `
(function(){ (function(){
var exports = {}; var exports = {};
var module;
function require(id){
if(id === 'tslib'){
return window['tslib']
}else{
console.log('missing require', id);
}
}
${scripts} ${scripts}
......
This diff is collapsed.
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
"name": "zeroing-code-divider", "name": "zeroing-code-divider",
"version": "1.0.0", "version": "1.0.0",
"main": "dist/index.js", "main": "dist/index.js",
"module": "dist/index.es.js",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
......
...@@ -11,12 +11,12 @@ export default class CustomManager { ...@@ -11,12 +11,12 @@ export default class CustomManager {
this.pool.push(custom); this.pool.push(custom);
} }
generate(){ generate() {
let scripts = ''; let scripts = '';
for(let {id, code} of this.pool){ for (let {id, code} of this.pool) {
scripts += ` scripts += `
/*=====START ${id} START=====*/ /*=====START ${id} START=====*/
module = { var module = {
exports: {} exports: {}
}; };
(function(module){ (function(module){
...@@ -29,7 +29,14 @@ exports['${id}'] = module.exports; ...@@ -29,7 +29,14 @@ exports['${id}'] = module.exports;
return ` return `
(function(){ (function(){
var exports = {}; var exports = {};
var module;
function require(id){
if(id === 'tslib'){
return window['tslib']
}else{
console.log('missing require', id);
}
}
${scripts} ${scripts}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment