1.0.8 • Published 5 years ago

twpack v1.0.8

Weekly downloads
2
License
ISC
Repository
-
Last release
5 years ago

twpack

tiny webpack tool

Install

npm install twpack

Usage


1. command line

npm install twpack -g

//a test.js file as below
//    function isPowerOf2(value) {
//       return (value & (value - 1)) == 0;
//    }
//    function isSeven(value) {
//       return (value === 7);
//    }
//    module.exports = {
//        isPowerOf2 : isPowerOf2,
//    	isSeven : isSeven
//    }

twpack test.js 

//will generate a _test.js as below
//    function webpackUniversalModuleDefinition(root, factory) {...some code...}
//    function modules(modules) {...some code...}
//    function module(module, exports, __webpack_require__) {
//        ...
//        function isPowerOf2(value) {
//           return (value & (value - 1)) == 0;
//        }
//        function isSeven(value) {
//           return (value === 7);
//        }
//        module.exports = {
//            isPowerOf2 : isPowerOf2,
//        	isSeven : isSeven
//        }
//        ...
//    }
//    function wrap() {...some code...}
//    webpackUniversalModuleDefinition(this,wrap)

//and then can be used either in node or in webbrowser

2. as a package

npm install twpack
var twpack = require("twpack")
var code = twpack.pack(srcFileName,dstFileName)


1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago