├── .husky
├── .gitignore
└── pre-commit
├── test
├── expected
│ ├── integration-test
│ │ ├── default
│ │ │ ├── README.md
│ │ │ ├── miniprogram_npm
│ │ │ │ ├── weui-miniprogram
│ │ │ │ │ ├── index.wxml
│ │ │ │ │ ├── badge
│ │ │ │ │ │ ├── badge.wxss
│ │ │ │ │ │ ├── badge.json
│ │ │ │ │ │ ├── badge.wxml
│ │ │ │ │ │ └── badge.js
│ │ │ │ │ ├── form-page
│ │ │ │ │ │ ├── form-page.wxss
│ │ │ │ │ │ ├── form-page.json
│ │ │ │ │ │ ├── form-page.js
│ │ │ │ │ │ └── form-page.wxml
│ │ │ │ │ ├── slideview
│ │ │ │ │ │ ├── slideview.wxss
│ │ │ │ │ │ └── slideview.json
│ │ │ │ │ ├── uploader
│ │ │ │ │ │ ├── uploader.wxss
│ │ │ │ │ │ └── uploader.json
│ │ │ │ │ ├── checkbox-group
│ │ │ │ │ │ ├── checkbox-group.wxss
│ │ │ │ │ │ ├── checkbox-group.json
│ │ │ │ │ │ └── checkbox-group.wxml
│ │ │ │ │ ├── navigation-bar
│ │ │ │ │ │ ├── navigation-bar.wxss
│ │ │ │ │ │ └── navigation-bar.json
│ │ │ │ │ ├── form
│ │ │ │ │ │ ├── form.wxml
│ │ │ │ │ │ └── form.json
│ │ │ │ │ ├── msg
│ │ │ │ │ │ ├── msg.wxss
│ │ │ │ │ │ ├── msg.json
│ │ │ │ │ │ ├── msg.js
│ │ │ │ │ │ └── msg.wxml
│ │ │ │ │ ├── cell
│ │ │ │ │ │ ├── cell.wxss
│ │ │ │ │ │ └── cell.json
│ │ │ │ │ ├── cells
│ │ │ │ │ │ ├── cells.json
│ │ │ │ │ │ ├── cells.wxss
│ │ │ │ │ │ └── cells.wxml
│ │ │ │ │ ├── grids
│ │ │ │ │ │ ├── grids.json
│ │ │ │ │ │ ├── grids.wxss
│ │ │ │ │ │ ├── grids.wxml
│ │ │ │ │ │ └── grids.js
│ │ │ │ │ ├── icon
│ │ │ │ │ │ ├── icon.json
│ │ │ │ │ │ ├── icon.wxss
│ │ │ │ │ │ └── icon.wxml
│ │ │ │ │ ├── dialog
│ │ │ │ │ │ ├── dialog.json
│ │ │ │ │ │ ├── dialog.wxss
│ │ │ │ │ │ └── dialog.wxml
│ │ │ │ │ ├── gallery
│ │ │ │ │ │ ├── gallery.json
│ │ │ │ │ │ ├── gallery.wxss
│ │ │ │ │ │ └── gallery.wxml
│ │ │ │ │ ├── loading
│ │ │ │ │ │ ├── loading.json
│ │ │ │ │ │ ├── loading.wxss
│ │ │ │ │ │ ├── loading.js
│ │ │ │ │ │ └── loading.wxml
│ │ │ │ │ ├── toptips
│ │ │ │ │ │ ├── toptips.json
│ │ │ │ │ │ ├── toptips.wxml
│ │ │ │ │ │ └── toptips.wxss
│ │ │ │ │ ├── actionsheet
│ │ │ │ │ │ ├── actionsheet.json
│ │ │ │ │ │ └── actionsheet.wxss
│ │ │ │ │ ├── half-screen-dialog
│ │ │ │ │ │ ├── half-screen-dialog.json
│ │ │ │ │ │ └── half-screen-dialog.wxss
│ │ │ │ │ ├── searchbar
│ │ │ │ │ │ ├── searchbar.wxss
│ │ │ │ │ │ └── searchbar.json
│ │ │ │ │ ├── tabbar
│ │ │ │ │ │ ├── tabbar.json
│ │ │ │ │ │ ├── tabbar.js
│ │ │ │ │ │ └── tabbar.wxml
│ │ │ │ │ ├── checkbox
│ │ │ │ │ │ ├── checkbox.json
│ │ │ │ │ │ ├── checkbox.wxml
│ │ │ │ │ │ └── checkbox.wxss
│ │ │ │ │ └── index.js
│ │ │ │ ├── miniprogram-api-promise
│ │ │ │ │ └── index.js
│ │ │ │ ├── weui-wxss
│ │ │ │ │ └── dist
│ │ │ │ │ │ └── example
│ │ │ │ │ │ └── images
│ │ │ │ │ │ └── layers
│ │ │ │ │ │ └── transparent.gif
│ │ │ │ └── mitt
│ │ │ │ │ └── index.js
│ │ │ ├── components
│ │ │ │ └── quickstart
│ │ │ │ │ ├── quickstart.json
│ │ │ │ │ ├── quickstart.wxml
│ │ │ │ │ ├── quickstart.wxss
│ │ │ │ │ ├── quickstart.js
│ │ │ │ │ └── quickstart.wxss.map
│ │ │ ├── pages
│ │ │ │ └── index
│ │ │ │ │ ├── index.wxss
│ │ │ │ │ ├── index.json
│ │ │ │ │ ├── index.wxss.map
│ │ │ │ │ └── index.js
│ │ │ ├── assets
│ │ │ │ └── img
│ │ │ │ │ └── gulp.png
│ │ │ ├── sitemap.json
│ │ │ ├── app.wxss
│ │ │ ├── app.wxss.map
│ │ │ ├── utils
│ │ │ │ ├── index.js.map
│ │ │ │ └── index.js
│ │ │ ├── app.json
│ │ │ ├── app.js
│ │ │ └── app.js.map
│ │ └── customize-npmDirname
│ │ │ ├── README.md
│ │ │ ├── dist
│ │ │ ├── weui-miniprogram
│ │ │ │ └── msg
│ │ │ │ │ ├── msg.wxss
│ │ │ │ │ ├── msg.json
│ │ │ │ │ ├── msg.js
│ │ │ │ │ └── msg.wxml
│ │ │ ├── miniprogram-api-promise
│ │ │ │ └── src
│ │ │ │ │ └── index.js
│ │ │ └── mitt
│ │ │ │ └── dist
│ │ │ │ └── mitt.js
│ │ │ ├── components
│ │ │ └── quickstart
│ │ │ │ ├── quickstart.json
│ │ │ │ ├── quickstart.wxml
│ │ │ │ ├── quickstart.wxss
│ │ │ │ ├── quickstart.js
│ │ │ │ └── quickstart.wxss.map
│ │ │ ├── pages
│ │ │ └── index
│ │ │ │ ├── index.wxss
│ │ │ │ ├── index.json
│ │ │ │ ├── index.wxss.map
│ │ │ │ └── index.js
│ │ │ ├── assets
│ │ │ └── img
│ │ │ │ └── gulp.png
│ │ │ ├── app.wxss
│ │ │ ├── sitemap.json
│ │ │ ├── app.wxss.map
│ │ │ ├── utils
│ │ │ ├── index.js.map
│ │ │ └── index.js
│ │ │ ├── app.json
│ │ │ ├── app.js
│ │ │ └── app.js.map
│ └── unit-test
│ │ ├── options-fullExtract
│ │ ├── dist
│ │ │ ├── weui-miniprogram
│ │ │ │ ├── index.wxml
│ │ │ │ ├── badge
│ │ │ │ │ ├── badge.wxss
│ │ │ │ │ ├── badge.json
│ │ │ │ │ ├── badge.wxml
│ │ │ │ │ └── badge.js
│ │ │ │ ├── uploader
│ │ │ │ │ ├── uploader.wxss
│ │ │ │ │ └── uploader.json
│ │ │ │ ├── form-page
│ │ │ │ │ ├── form-page.wxss
│ │ │ │ │ ├── form-page.json
│ │ │ │ │ ├── form-page.js
│ │ │ │ │ └── form-page.wxml
│ │ │ │ ├── slideview
│ │ │ │ │ ├── slideview.wxss
│ │ │ │ │ └── slideview.json
│ │ │ │ ├── checkbox-group
│ │ │ │ │ ├── checkbox-group.wxss
│ │ │ │ │ ├── checkbox-group.json
│ │ │ │ │ └── checkbox-group.wxml
│ │ │ │ ├── navigation-bar
│ │ │ │ │ ├── navigation-bar.wxss
│ │ │ │ │ └── navigation-bar.json
│ │ │ │ ├── form
│ │ │ │ │ ├── form.wxml
│ │ │ │ │ └── form.json
│ │ │ │ ├── msg
│ │ │ │ │ ├── msg.json
│ │ │ │ │ ├── msg.wxss
│ │ │ │ │ ├── msg.js
│ │ │ │ │ └── msg.wxml
│ │ │ │ ├── cell
│ │ │ │ │ ├── cell.wxss
│ │ │ │ │ └── cell.json
│ │ │ │ ├── cells
│ │ │ │ │ ├── cells.json
│ │ │ │ │ ├── cells.wxss
│ │ │ │ │ └── cells.wxml
│ │ │ │ ├── grids
│ │ │ │ │ ├── grids.json
│ │ │ │ │ ├── grids.wxss
│ │ │ │ │ ├── grids.wxml
│ │ │ │ │ └── grids.js
│ │ │ │ ├── icon
│ │ │ │ │ ├── icon.json
│ │ │ │ │ ├── icon.wxss
│ │ │ │ │ └── icon.wxml
│ │ │ │ ├── dialog
│ │ │ │ │ ├── dialog.json
│ │ │ │ │ ├── dialog.wxss
│ │ │ │ │ └── dialog.wxml
│ │ │ │ ├── gallery
│ │ │ │ │ ├── gallery.json
│ │ │ │ │ ├── gallery.wxss
│ │ │ │ │ └── gallery.wxml
│ │ │ │ ├── loading
│ │ │ │ │ ├── loading.json
│ │ │ │ │ ├── loading.wxss
│ │ │ │ │ ├── loading.js
│ │ │ │ │ └── loading.wxml
│ │ │ │ ├── toptips
│ │ │ │ │ ├── toptips.json
│ │ │ │ │ ├── toptips.wxml
│ │ │ │ │ └── toptips.wxss
│ │ │ │ ├── actionsheet
│ │ │ │ │ ├── actionsheet.json
│ │ │ │ │ └── actionsheet.wxss
│ │ │ │ ├── half-screen-dialog
│ │ │ │ │ ├── half-screen-dialog.json
│ │ │ │ │ ├── half-screen-dialog.wxss
│ │ │ │ │ └── half-screen-dialog.js
│ │ │ │ ├── searchbar
│ │ │ │ │ ├── searchbar.wxss
│ │ │ │ │ └── searchbar.json
│ │ │ │ ├── tabbar
│ │ │ │ │ ├── tabbar.json
│ │ │ │ │ ├── tabbar.js
│ │ │ │ │ └── tabbar.wxml
│ │ │ │ ├── checkbox
│ │ │ │ │ ├── checkbox.json
│ │ │ │ │ ├── checkbox.wxml
│ │ │ │ │ └── checkbox.wxss
│ │ │ │ └── index.js
│ │ │ ├── miniprogram-api-promise
│ │ │ │ └── src
│ │ │ │ │ └── index.js
│ │ │ ├── @miniprogram-component-plus
│ │ │ │ └── sticky
│ │ │ │ │ ├── index.json
│ │ │ │ │ ├── index.wxss
│ │ │ │ │ ├── index.wxml
│ │ │ │ │ └── index.wxs
│ │ │ ├── weui-wxss
│ │ │ │ └── dist
│ │ │ │ │ ├── example
│ │ │ │ │ ├── badge
│ │ │ │ │ │ ├── badge.js
│ │ │ │ │ │ └── badge.wxss
│ │ │ │ │ ├── images
│ │ │ │ │ │ └── layers
│ │ │ │ │ │ │ └── transparent.gif
│ │ │ │ │ └── actionsheet
│ │ │ │ │ │ ├── actionsheet.wxss
│ │ │ │ │ │ └── actionsheet.js
│ │ │ │ │ └── mixin
│ │ │ │ │ └── themeChanged.js
│ │ │ ├── lodash
│ │ │ │ ├── _Symbol.js
│ │ │ │ ├── _coreJsData.js
│ │ │ │ ├── _freeGlobal.js
│ │ │ │ ├── _nativeCreate.js
│ │ │ │ ├── _Map.js
│ │ │ │ ├── _listCacheClear.js
│ │ │ │ ├── _defineProperty.js
│ │ │ │ ├── _root.js
│ │ │ │ ├── _hashClear.js
│ │ │ │ ├── _getValue.js
│ │ │ │ ├── _mapCacheGet.js
│ │ │ │ ├── _mapCacheHas.js
│ │ │ │ ├── _listCacheHas.js
│ │ │ │ ├── _getMapData.js
│ │ │ │ ├── _mapCacheClear.js
│ │ │ │ ├── _isKeyable.js
│ │ │ │ ├── _listCacheGet.js
│ │ │ │ ├── _hashDelete.js
│ │ │ │ ├── _mapCacheDelete.js
│ │ │ │ ├── _getNative.js
│ │ │ │ ├── _assocIndexOf.js
│ │ │ │ ├── _mapCacheSet.js
│ │ │ │ ├── isArray.js
│ │ │ │ ├── _toKey.js
│ │ │ │ ├── _arrayMap.js
│ │ │ │ ├── _isMasked.js
│ │ │ │ ├── _castPath.js
│ │ │ │ ├── _objectToString.js
│ │ │ │ ├── _listCacheSet.js
│ │ │ │ ├── _toSource.js
│ │ │ │ ├── _hashSet.js
│ │ │ │ ├── toString.js
│ │ │ │ ├── _baseGet.js
│ │ │ │ ├── _hashHas.js
│ │ │ │ ├── _baseAssignValue.js
│ │ │ │ ├── isObjectLike.js
│ │ │ │ ├── _memoizeCapped.js
│ │ │ │ ├── isSymbol.js
│ │ │ │ ├── _isIndex.js
│ │ │ │ ├── isObject.js
│ │ │ │ ├── _Hash.js
│ │ │ │ └── _hashGet.js
│ │ │ ├── @sindresorhus
│ │ │ │ └── slugify
│ │ │ │ │ └── overridable-replacements.js
│ │ │ ├── mitt
│ │ │ │ └── dist
│ │ │ │ │ ├── mitt.js
│ │ │ │ │ ├── mitt.mjs
│ │ │ │ │ └── mitt.umd.js
│ │ │ └── escape-string-regexp
│ │ │ │ └── index.js
│ │ ├── import-special-dep.wxss
│ │ ├── import-deep-scope-dep.js
│ │ ├── import-special-dep.js
│ │ ├── import-normal-dep.wxss
│ │ ├── require-dep.js
│ │ ├── import-special-dep.json
│ │ └── import-normal-dep.js
│ │ ├── import-wxs-dep.json
│ │ ├── miniprogram_npm
│ │ │ └── @vant
│ │ │ │ └── weapp
│ │ │ │ ├── loading
│ │ │ │ ├── index.json
│ │ │ │ ├── index.js
│ │ │ │ ├── index.wxs
│ │ │ │ └── index.wxml
│ │ │ │ ├── wxs
│ │ │ │ ├── array.wxs
│ │ │ │ ├── utils.wxs
│ │ │ │ ├── add-unit.wxs
│ │ │ │ └── object.wxs
│ │ │ │ └── mixins
│ │ │ │ └── basic.js
│ │ └── import-wxs-dep.json
│ │ ├── customize-npmDirname
│ │ ├── dist
│ │ │ ├── weui-miniprogram
│ │ │ │ ├── msg
│ │ │ │ │ ├── msg.wxss
│ │ │ │ │ ├── msg.json
│ │ │ │ │ ├── msg.js
│ │ │ │ │ └── msg.wxml
│ │ │ │ ├── index.js
│ │ │ │ └── loading
│ │ │ │ │ └── loading.js
│ │ │ ├── miniprogram-api-promise
│ │ │ │ └── src
│ │ │ │ │ └── index.js
│ │ │ ├── @miniprogram-component-plus
│ │ │ │ └── sticky
│ │ │ │ │ ├── index.json
│ │ │ │ │ ├── index.wxss
│ │ │ │ │ ├── index.wxml
│ │ │ │ │ └── index.wxs
│ │ │ ├── lodash
│ │ │ │ ├── _Symbol.js
│ │ │ │ ├── _coreJsData.js
│ │ │ │ ├── _freeGlobal.js
│ │ │ │ ├── _Map.js
│ │ │ │ ├── _nativeCreate.js
│ │ │ │ ├── _listCacheClear.js
│ │ │ │ ├── _defineProperty.js
│ │ │ │ ├── _root.js
│ │ │ │ ├── _hashClear.js
│ │ │ │ ├── _getValue.js
│ │ │ │ ├── _mapCacheGet.js
│ │ │ │ ├── _mapCacheHas.js
│ │ │ │ ├── _listCacheHas.js
│ │ │ │ ├── _getMapData.js
│ │ │ │ ├── _mapCacheClear.js
│ │ │ │ ├── _isKeyable.js
│ │ │ │ ├── _listCacheGet.js
│ │ │ │ ├── _hashDelete.js
│ │ │ │ ├── _mapCacheDelete.js
│ │ │ │ ├── _getNative.js
│ │ │ │ ├── _assocIndexOf.js
│ │ │ │ ├── _mapCacheSet.js
│ │ │ │ ├── isArray.js
│ │ │ │ ├── _toKey.js
│ │ │ │ ├── _arrayMap.js
│ │ │ │ ├── _isMasked.js
│ │ │ │ ├── _castPath.js
│ │ │ │ ├── _objectToString.js
│ │ │ │ ├── _listCacheSet.js
│ │ │ │ ├── _toSource.js
│ │ │ │ ├── _hashSet.js
│ │ │ │ ├── toString.js
│ │ │ │ ├── _baseGet.js
│ │ │ │ ├── _hashHas.js
│ │ │ │ ├── _baseAssignValue.js
│ │ │ │ ├── isObjectLike.js
│ │ │ │ ├── _memoizeCapped.js
│ │ │ │ ├── isSymbol.js
│ │ │ │ ├── _isIndex.js
│ │ │ │ ├── isObject.js
│ │ │ │ ├── _Hash.js
│ │ │ │ └── _hashGet.js
│ │ │ ├── @sindresorhus
│ │ │ │ └── slugify
│ │ │ │ │ └── overridable-replacements.js
│ │ │ └── escape-string-regexp
│ │ │ │ └── index.js
│ │ ├── import-special-dep.wxss
│ │ ├── import-deep-scope-dep.js
│ │ ├── import-special-dep.js
│ │ ├── import-normal-dep.wxss
│ │ ├── require-dep.js
│ │ ├── import-special-dep.json
│ │ └── import-normal-dep.js
│ │ ├── import-deep-scope-dep.js
│ │ ├── import-deep-scope-dep.js
│ │ └── miniprogram_npm
│ │ │ ├── @sindresorhus
│ │ │ └── slugify
│ │ │ │ └── overridable-replacements.js
│ │ │ └── escape-string-regexp
│ │ │ └── index.js
│ │ ├── import-normal-dep.js
│ │ ├── miniprogram_npm
│ │ │ ├── miniprogram-api-promise
│ │ │ │ └── index.js
│ │ │ └── lodash
│ │ │ │ ├── _Symbol.js
│ │ │ │ ├── _coreJsData.js
│ │ │ │ ├── _freeGlobal.js
│ │ │ │ ├── _Map.js
│ │ │ │ ├── _nativeCreate.js
│ │ │ │ ├── _listCacheClear.js
│ │ │ │ ├── _defineProperty.js
│ │ │ │ ├── _root.js
│ │ │ │ ├── _hashClear.js
│ │ │ │ ├── _getValue.js
│ │ │ │ ├── _mapCacheGet.js
│ │ │ │ ├── _mapCacheHas.js
│ │ │ │ ├── _listCacheHas.js
│ │ │ │ ├── _getMapData.js
│ │ │ │ ├── _isKeyable.js
│ │ │ │ ├── _mapCacheClear.js
│ │ │ │ ├── _listCacheGet.js
│ │ │ │ ├── _hashDelete.js
│ │ │ │ ├── _mapCacheDelete.js
│ │ │ │ ├── _getNative.js
│ │ │ │ ├── _assocIndexOf.js
│ │ │ │ ├── _mapCacheSet.js
│ │ │ │ ├── isArray.js
│ │ │ │ ├── _toKey.js
│ │ │ │ ├── _arrayMap.js
│ │ │ │ ├── _isMasked.js
│ │ │ │ ├── _castPath.js
│ │ │ │ ├── _objectToString.js
│ │ │ │ ├── _listCacheSet.js
│ │ │ │ ├── _toSource.js
│ │ │ │ ├── _hashSet.js
│ │ │ │ ├── toString.js
│ │ │ │ ├── _baseGet.js
│ │ │ │ ├── _hashHas.js
│ │ │ │ ├── _baseAssignValue.js
│ │ │ │ ├── isObjectLike.js
│ │ │ │ ├── _memoizeCapped.js
│ │ │ │ ├── isSymbol.js
│ │ │ │ ├── _isIndex.js
│ │ │ │ ├── isObject.js
│ │ │ │ └── _Hash.js
│ │ └── import-normal-dep.js
│ │ ├── import-special-dep.json
│ │ ├── miniprogram_npm
│ │ │ ├── weui-miniprogram
│ │ │ │ └── msg
│ │ │ │ │ ├── msg.json
│ │ │ │ │ ├── msg.wxss
│ │ │ │ │ ├── msg.js
│ │ │ │ │ └── msg.wxml
│ │ │ └── @miniprogram-component-plus
│ │ │ │ └── sticky
│ │ │ │ ├── index.json
│ │ │ │ ├── index.wxss
│ │ │ │ ├── index.wxml
│ │ │ │ └── index.wxs
│ │ └── import-special-dep.json
│ │ ├── import-special-dep.wxss
│ │ └── import-special-dep.wxss
│ │ ├── import-special-dep.js
│ │ ├── import-special-dep.js
│ │ └── miniprogram_npm
│ │ │ └── weui-miniprogram
│ │ │ ├── index.js
│ │ │ └── loading
│ │ │ └── loading.js
│ │ ├── require-dep.js
│ │ ├── require-dep.js
│ │ └── miniprogram_npm
│ │ │ └── weui-miniprogram
│ │ │ └── index.js
│ │ └── import-normal-dep.wxss
│ │ └── import-normal-dep.wxss
├── fixtures
│ ├── integration-test
│ │ ├── src
│ │ │ ├── README.md
│ │ │ ├── components
│ │ │ │ └── quickstart
│ │ │ │ │ ├── quickstart.json
│ │ │ │ │ ├── quickstart.wxml
│ │ │ │ │ └── quickstart.less
│ │ │ ├── assets
│ │ │ │ └── img
│ │ │ │ │ └── gulp.png
│ │ │ ├── utils
│ │ │ │ └── index.ts
│ │ │ ├── pages
│ │ │ │ └── index
│ │ │ │ │ ├── index.less
│ │ │ │ │ └── index.json
│ │ │ ├── sitemap.json
│ │ │ ├── app.less
│ │ │ ├── app.json
│ │ │ └── app.ts
│ │ ├── .eslintignore
│ │ ├── .gitignore
│ │ ├── .eslintrc.js
│ │ ├── .editorconfig
│ │ ├── README.md
│ │ ├── package.json
│ │ └── tsconfig.json
│ └── unit-test
│ │ ├── local-dep
│ │ ├── page
│ │ │ ├── page.js
│ │ │ ├── page.json
│ │ │ ├── page.wxml
│ │ │ └── page.wxss
│ │ ├── script.js
│ │ └── style.wxss
│ │ ├── import-special-dep.wxss
│ │ ├── import-deep-scope-dep.js
│ │ ├── import-wxs-dep.json
│ │ ├── import-special-dep.js
│ │ ├── import-normal-dep.wxss
│ │ ├── require-dep.js
│ │ ├── import-special-dep.json
│ │ └── import-normal-dep.js
└── utils.js
├── .eslintignore
├── .eslintrc.js
├── docs
├── gulp-mp-npm.key
└── gulp-mp-npm.png
├── lib
└── utils
│ ├── replaceNodeModulesPath.js
│ ├── index.js
│ ├── getNodeModulesPath.js
│ └── getPackageName.js
├── .gitignore
└── .editorconfig
/.husky/.gitignore:
--------------------------------------------------------------------------------
1 | _
2 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/README.md:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/fixtures/integration-test/src/README.md:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/fixtures/unit-test/local-dep/page/page.js:
--------------------------------------------------------------------------------
1 | Page();
2 |
--------------------------------------------------------------------------------
/test/fixtures/unit-test/local-dep/page/page.json:
--------------------------------------------------------------------------------
1 | {}
2 |
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | dist
2 | test
3 | __tests__
4 | node_modules
5 |
--------------------------------------------------------------------------------
/test/expected/integration-test/customize-npmDirname/README.md:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/fixtures/unit-test/local-dep/script.js:
--------------------------------------------------------------------------------
1 | console.log('script');
2 |
--------------------------------------------------------------------------------
/test/fixtures/unit-test/local-dep/style.wxss:
--------------------------------------------------------------------------------
1 | page { background: #fff; }
2 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/test/fixtures/unit-test/local-dep/page/page.wxml:
--------------------------------------------------------------------------------
1 | Page
2 |
--------------------------------------------------------------------------------
/test/fixtures/unit-test/local-dep/page/page.wxss:
--------------------------------------------------------------------------------
1 | .page { background: #fff; }
2 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/badge/badge.wxss:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | extends: ['soda-works'],
3 | globals: {},
4 | };
5 |
--------------------------------------------------------------------------------
/docs/gulp-mp-npm.key:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cong-min/gulp-mp-npm/HEAD/docs/gulp-mp-npm.key
--------------------------------------------------------------------------------
/docs/gulp-mp-npm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cong-min/gulp-mp-npm/HEAD/docs/gulp-mp-npm.png
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/badge/badge.wxss:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/uploader/uploader.wxss:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/form-page/form-page.wxss:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/slideview/slideview.wxss:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/test/fixtures/integration-test/.eslintignore:
--------------------------------------------------------------------------------
1 | .miniprogram
2 | test
3 | __tests__
4 | node_modules
5 |
--------------------------------------------------------------------------------
/.husky/pre-commit:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | . "$(dirname "$0")/_/husky.sh"
3 |
4 | npx --no-install lint-staged
5 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/form-page/form-page.wxss:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/slideview/slideview.wxss:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/uploader/uploader.wxss:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/checkbox-group/checkbox-group.wxss:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/navigation-bar/navigation-bar.wxss:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/test/fixtures/unit-test/import-special-dep.wxss:
--------------------------------------------------------------------------------
1 | @import 'weui-miniprogram/weui-wxss/dist/style/weui.wxss';
2 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/checkbox-group/checkbox-group.wxss:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/navigation-bar/navigation-bar.wxss:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-wxs-dep.json/miniprogram_npm/@vant/weapp/loading/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
4 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/form/form.wxml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/test/fixtures/unit-test/import-deep-scope-dep.js:
--------------------------------------------------------------------------------
1 | import slugify from '@sindresorhus/slugify';
2 | export default slugify;
3 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/form/form.wxml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/components/quickstart/quickstart.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/weui-miniprogram/msg/msg.wxss:
--------------------------------------------------------------------------------
1 | .weui-msg__icon-img{width:190rpx;height:190rpx}
2 |
3 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/import-special-dep.wxss:
--------------------------------------------------------------------------------
1 | @import './dist/weui-miniprogram/weui-wxss/dist/style/weui.wxss';
2 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/msg/msg.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/msg/msg.wxss:
--------------------------------------------------------------------------------
1 | .weui-msg__icon-img{width:190rpx;height:190rpx}
2 |
3 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/import-special-dep.wxss:
--------------------------------------------------------------------------------
1 | @import './dist/weui-miniprogram/weui-wxss/dist/style/weui.wxss';
2 |
--------------------------------------------------------------------------------
/test/fixtures/integration-test/src/components/quickstart/quickstart.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
5 |
--------------------------------------------------------------------------------
/test/expected/integration-test/customize-npmDirname/dist/weui-miniprogram/msg/msg.wxss:
--------------------------------------------------------------------------------
1 | .weui-msg__icon-img{width:190rpx;height:190rpx}
2 |
3 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/msg/msg.wxss:
--------------------------------------------------------------------------------
1 | .weui-msg__icon-img{width:190rpx;height:190rpx}
2 |
3 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/miniprogram-api-promise/src/index.js:
--------------------------------------------------------------------------------
1 | export {promisify, promisifyAll} from './promise'
2 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/weui-miniprogram/msg/msg.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/miniprogram-api-promise/src/index.js:
--------------------------------------------------------------------------------
1 | export {promisify, promisifyAll} from './promise'
2 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/badge/badge.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/cell/cell.wxss:
--------------------------------------------------------------------------------
1 | .weui-cell_wxss.weui-cell_wxss:before{display:block}
2 |
3 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/cells/cells.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/form/form.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/grids/grids.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/icon/icon.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/test/fixtures/unit-test/import-wxs-dep.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | "van-loading": "@vant/weapp/loading/index"
4 | }
5 | }
--------------------------------------------------------------------------------
/test/expected/integration-test/customize-npmDirname/dist/miniprogram-api-promise/src/index.js:
--------------------------------------------------------------------------------
1 | export {promisify, promisifyAll} from './promise'
2 |
--------------------------------------------------------------------------------
/test/expected/integration-test/customize-npmDirname/dist/weui-miniprogram/msg/msg.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/miniprogram-api-promise/index.js:
--------------------------------------------------------------------------------
1 | export {promisify, promisifyAll} from './src/promise'
2 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/badge/badge.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/cell/cell.wxss:
--------------------------------------------------------------------------------
1 | .weui-cell_wxss.weui-cell_wxss:before{display:block}
2 |
3 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/cells/cells.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/form/form.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/grids/grids.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/icon/icon.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/msg/msg.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/dialog/dialog.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/gallery/gallery.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/grids/grids.wxss:
--------------------------------------------------------------------------------
1 | .weui-grid .weui-grid__icon_img{width:100%;height:100%}
2 |
3 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/loading/loading.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/toptips/toptips.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/test/expected/integration-test/customize-npmDirname/components/quickstart/quickstart.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/dialog/dialog.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/gallery/gallery.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/grids/grids.wxss:
--------------------------------------------------------------------------------
1 | .weui-grid .weui-grid__icon_img{width:100%;height:100%}
2 |
3 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/loading/loading.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/toptips/toptips.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/test/expected/unit-test/import-deep-scope-dep.js/import-deep-scope-dep.js:
--------------------------------------------------------------------------------
1 | import slugify from '@sindresorhus/slugify';
2 | export default slugify;
3 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-normal-dep.js/miniprogram_npm/miniprogram-api-promise/index.js:
--------------------------------------------------------------------------------
1 | export {promisify, promisifyAll} from './src/promise'
2 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-special-dep.json/miniprogram_npm/weui-miniprogram/msg/msg.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/test/expected/unit-test/import-special-dep.json/miniprogram_npm/weui-miniprogram/msg/msg.wxss:
--------------------------------------------------------------------------------
1 | .weui-msg__icon-img{width:190rpx;height:190rpx}
2 |
3 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-special-dep.wxss/import-special-dep.wxss:
--------------------------------------------------------------------------------
1 | @import './miniprogram_npm/weui-miniprogram/weui-wxss/dist/style/weui.wxss';
2 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/form-page/form-page.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/slideview/slideview.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/form-page/form-page.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/slideview/slideview.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/@miniprogram-component-plus/sticky/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/test/expected/unit-test/import-wxs-dep.json/import-wxs-dep.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | "van-loading": "@vant/weapp/loading/index"
4 | }
5 | }
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/@miniprogram-component-plus/sticky/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/actionsheet/actionsheet.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-wxss/dist/example/badge/badge.js:
--------------------------------------------------------------------------------
1 | Page({
2 | mixins: [require('../../mixin/themeChanged')],
3 | });
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/actionsheet/actionsheet.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/import-deep-scope-dep.js:
--------------------------------------------------------------------------------
1 | import slugify from './dist/@sindresorhus/slugify/index.js';
2 | export default slugify;
3 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/navigation-bar/navigation-bar.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/import-deep-scope-dep.js:
--------------------------------------------------------------------------------
1 | import slugify from './dist/@sindresorhus/slugify/index.js';
2 | export default slugify;
3 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/navigation-bar/navigation-bar.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/test/expected/integration-test/default/pages/index/index.wxss:
--------------------------------------------------------------------------------
1 | /* index.less */
2 | .main-msg .weui-msg__icon-img {
3 | width: 250rpx;
4 | height: 250rpx;
5 | }
6 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/gallery/gallery.wxss:
--------------------------------------------------------------------------------
1 | .weui-gallery{display:none}.weui-gallery_show.weui-gallery{display:flex}
2 |
3 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/half-screen-dialog/half-screen-dialog.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/test/fixtures/integration-test/src/assets/img/gulp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cong-min/gulp-mp-npm/HEAD/test/fixtures/integration-test/src/assets/img/gulp.png
--------------------------------------------------------------------------------
/test/fixtures/unit-test/import-special-dep.js:
--------------------------------------------------------------------------------
1 | import 'weui-miniprogram';
2 | import 'weui-miniprogram/index.js';
3 | import 'weui-miniprogram/loading/loading.js';
4 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/assets/img/gulp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cong-min/gulp-mp-npm/HEAD/test/expected/integration-test/default/assets/img/gulp.png
--------------------------------------------------------------------------------
/test/expected/unit-test/import-special-dep.json/miniprogram_npm/@miniprogram-component-plus/sticky/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/@miniprogram-component-plus/sticky/index.wxss:
--------------------------------------------------------------------------------
1 | .weui-sticky{position:relative}.weui-sticky__fixed{position:fixed;left:0;top:0}
--------------------------------------------------------------------------------
/test/fixtures/integration-test/src/utils/index.ts:
--------------------------------------------------------------------------------
1 | export { promisifyAll, promisify } from 'miniprogram-api-promise';
2 | import mitt from 'mitt';
3 | export { mitt };
4 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/gallery/gallery.wxss:
--------------------------------------------------------------------------------
1 | .weui-gallery{display:none}.weui-gallery_show.weui-gallery{display:flex}
2 |
3 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/half-screen-dialog/half-screen-dialog.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/@miniprogram-component-plus/sticky/index.wxss:
--------------------------------------------------------------------------------
1 | .weui-sticky{position:relative}.weui-sticky__fixed{position:fixed;left:0;top:0}
--------------------------------------------------------------------------------
/test/expected/integration-test/customize-npmDirname/pages/index/index.wxss:
--------------------------------------------------------------------------------
1 | /* index.less */
2 | .main-msg .weui-msg__icon-img {
3 | width: 250rpx;
4 | height: 250rpx;
5 | }
6 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/badge/badge.wxml:
--------------------------------------------------------------------------------
1 | {{content}}
2 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/badge/badge.wxml:
--------------------------------------------------------------------------------
1 | {{content}}
2 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-special-dep.json/miniprogram_npm/@miniprogram-component-plus/sticky/index.wxss:
--------------------------------------------------------------------------------
1 | .weui-sticky{position:relative}.weui-sticky__fixed{position:fixed;left:0;top:0}
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/cell/cell.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "mp-cells": "../cells/cells"
5 | }
6 | }
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/searchbar/searchbar.wxss:
--------------------------------------------------------------------------------
1 | .weui-search-bar__label text{display:inline-block;font-size:14px;vertical-align:middle}
2 |
3 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/tabbar/tabbar.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "mp-badge": "../badge/badge"
5 | }
6 | }
--------------------------------------------------------------------------------
/test/fixtures/unit-test/import-normal-dep.wxss:
--------------------------------------------------------------------------------
1 | @import 'weui-wxss';
2 | @import url('weui-wxss/dist/style/widget/weui-button/weui-button.wxss');
3 | @import './local-dep/style.wxss';
4 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/cell/cell.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "mp-cells": "../cells/cells"
5 | }
6 | }
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/searchbar/searchbar.wxss:
--------------------------------------------------------------------------------
1 | .weui-search-bar__label text{display:inline-block;font-size:14px;vertical-align:middle}
2 |
3 |
--------------------------------------------------------------------------------
/test/fixtures/unit-test/require-dep.js:
--------------------------------------------------------------------------------
1 | const lodash = require('lodash');
2 | require('weui-miniprogram');
3 | require('./local-dep/script.js');
4 | module.exports = { lodash, slugify };
5 |
--------------------------------------------------------------------------------
/test/expected/integration-test/customize-npmDirname/assets/img/gulp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cong-min/gulp-mp-npm/HEAD/test/expected/integration-test/customize-npmDirname/assets/img/gulp.png
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/tabbar/tabbar.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "mp-badge": "../badge/badge"
5 | }
6 | }
--------------------------------------------------------------------------------
/test/expected/unit-test/import-special-dep.js/import-special-dep.js:
--------------------------------------------------------------------------------
1 | import 'weui-miniprogram/index.js';
2 | import 'weui-miniprogram/index.js';
3 | import 'weui-miniprogram/loading/loading.js';
4 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/uploader/uploader.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "mp-gallery": "../gallery/gallery"
5 | }
6 | }
--------------------------------------------------------------------------------
/test/fixtures/integration-test/src/pages/index/index.less:
--------------------------------------------------------------------------------
1 | /* index.less */
2 | .main-msg {
3 | .weui-msg__icon-img {
4 | width: 250rpx;
5 | height: 250rpx;
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/uploader/uploader.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "mp-gallery": "../gallery/gallery"
5 | }
6 | }
--------------------------------------------------------------------------------
/test/expected/integration-test/default/pages/index/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | "mp-msg": "weui-miniprogram/msg/msg",
4 | "quickstart": "/components/quickstart/quickstart"
5 | }
6 | }
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/lodash/_Symbol.js:
--------------------------------------------------------------------------------
1 | var root = require('./_root');
2 |
3 | /** Built-in value references. */
4 | var Symbol = root.Symbol;
5 |
6 | module.exports = Symbol;
7 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/checkbox-group/checkbox-group.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "mp-cells": "../cells/cells"
5 | }
6 | }
--------------------------------------------------------------------------------
/test/fixtures/integration-test/src/pages/index/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | "mp-msg": "weui-miniprogram/msg/msg",
4 | "quickstart": "/components/quickstart/quickstart"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/checkbox-group/checkbox-group.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "mp-cells": "../cells/cells"
5 | }
6 | }
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/lodash/_Symbol.js:
--------------------------------------------------------------------------------
1 | var root = require('./_root');
2 |
3 | /** Built-in value references. */
4 | var Symbol = root.Symbol;
5 |
6 | module.exports = Symbol;
7 |
--------------------------------------------------------------------------------
/test/expected/unit-test/require-dep.js/require-dep.js:
--------------------------------------------------------------------------------
1 | const lodash = require('lodash');
2 | require('weui-miniprogram/index.js');
3 | require('./local-dep/script.js');
4 | module.exports = { lodash, slugify };
5 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/import-special-dep.js:
--------------------------------------------------------------------------------
1 | import './dist/weui-miniprogram/index.js';
2 | import './dist/weui-miniprogram/index.js';
3 | import './dist/weui-miniprogram/loading/loading.js';
4 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-wxs-dep.json/miniprogram_npm/@vant/weapp/wxs/array.wxs:
--------------------------------------------------------------------------------
1 | function isArray(array) {
2 | return array && array.constructor === 'Array';
3 | }
4 |
5 | module.exports.isArray = isArray;
6 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/import-special-dep.js:
--------------------------------------------------------------------------------
1 | import './dist/weui-miniprogram/index.js';
2 | import './dist/weui-miniprogram/index.js';
3 | import './dist/weui-miniprogram/loading/loading.js';
4 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-normal-dep.js/miniprogram_npm/lodash/_Symbol.js:
--------------------------------------------------------------------------------
1 | var root = require('./_root');
2 |
3 | /** Built-in value references. */
4 | var Symbol = root.Symbol;
5 |
6 | module.exports = Symbol;
7 |
--------------------------------------------------------------------------------
/test/expected/integration-test/customize-npmDirname/pages/index/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | "mp-msg": "../../dist/weui-miniprogram/msg/msg",
4 | "quickstart": "/components/quickstart/quickstart"
5 | }
6 | }
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/actionsheet/actionsheet.wxss:
--------------------------------------------------------------------------------
1 | .weui-mask.weui-mask_hidden{opacity:0;transform:scale3d(1,1,0)}.weui-mask{opacity:1;transform:scale3d(1,1,1);transition:all 0.3s}
2 |
3 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/searchbar/searchbar.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "mp-cells": "../cells/cells",
5 | "mp-cell": "../cell/cell"
6 | }
7 | }
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/searchbar/searchbar.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "mp-cells": "../cells/cells",
5 | "mp-cell": "../cell/cell"
6 | }
7 | }
--------------------------------------------------------------------------------
/test/expected/integration-test/default/sitemap.json:
--------------------------------------------------------------------------------
1 | {
2 | "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
3 | "rules": [{
4 | "action": "allow",
5 | "page": "*"
6 | }]
7 | }
--------------------------------------------------------------------------------
/test/fixtures/integration-test/src/sitemap.json:
--------------------------------------------------------------------------------
1 | {
2 | "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
3 | "rules": [{
4 | "action": "allow",
5 | "page": "*"
6 | }]
7 | }
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/actionsheet/actionsheet.wxss:
--------------------------------------------------------------------------------
1 | .weui-mask.weui-mask_hidden{opacity:0;transform:scale3d(1,1,0)}.weui-mask{opacity:1;transform:scale3d(1,1,1);transition:all 0.3s}
2 |
3 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/import-normal-dep.wxss:
--------------------------------------------------------------------------------
1 | @import './dist/weui-wxss/dist/style/weui.wxss';
2 | @import url('./dist/weui-wxss/dist/style/widget/weui-button/weui-button.wxss');
3 | @import './local-dep/style.wxss';
4 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/require-dep.js:
--------------------------------------------------------------------------------
1 | const lodash = require('./dist/lodash/lodash.js');
2 | require('./dist/weui-miniprogram/index.js');
3 | require('./local-dep/script.js');
4 | module.exports = { lodash, slugify };
5 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/import-normal-dep.wxss:
--------------------------------------------------------------------------------
1 | @import './dist/weui-wxss/dist/style/weui.wxss';
2 | @import url('./dist/weui-wxss/dist/style/widget/weui-button/weui-button.wxss');
3 | @import './local-dep/style.wxss';
4 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/require-dep.js:
--------------------------------------------------------------------------------
1 | const lodash = require('./dist/lodash/lodash.js');
2 | require('./dist/weui-miniprogram/index.js');
3 | require('./local-dep/script.js');
4 | module.exports = { lodash, slugify };
5 |
--------------------------------------------------------------------------------
/test/fixtures/integration-test/src/app.less:
--------------------------------------------------------------------------------
1 | /* app.less **/
2 | @import (css) 'weui-miniprogram/weui-wxss/dist/style/weui.wxss';
3 |
4 | page {
5 | display: flex;
6 | flex-direction: column;
7 | align-items: stretch;
8 | }
9 |
--------------------------------------------------------------------------------
/test/fixtures/unit-test/import-special-dep.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | "mp-msg": "weui-miniprogram/msg/msg",
4 | "mp-sticky": "@miniprogram-component-plus/sticky",
5 | "page": "./local-dep/page/page"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/lib/utils/replaceNodeModulesPath.js:
--------------------------------------------------------------------------------
1 | // 替换所有 node_modules 为 npmDirname
2 | const { slash } = require('./index');
3 |
4 | module.exports = (filepath = '', npmDirname) =>
5 | slash(filepath).replace(/\/node_modules\//g, `/${npmDirname}/`);
6 |
--------------------------------------------------------------------------------
/test/expected/integration-test/customize-npmDirname/app.wxss:
--------------------------------------------------------------------------------
1 | /* app.less **/
2 | @import './dist/weui-miniprogram/weui-wxss/dist/style/weui.wxss';
3 | page {
4 | display: flex;
5 | flex-direction: column;
6 | align-items: stretch;
7 | }
8 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/app.wxss:
--------------------------------------------------------------------------------
1 | /* app.less **/
2 | @import './miniprogram_npm/weui-miniprogram/weui-wxss/dist/style/weui.wxss';
3 | page {
4 | display: flex;
5 | flex-direction: column;
6 | align-items: stretch;
7 | }
8 |
--------------------------------------------------------------------------------
/test/expected/integration-test/customize-npmDirname/sitemap.json:
--------------------------------------------------------------------------------
1 | {
2 | "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
3 | "rules": [{
4 | "action": "allow",
5 | "page": "*"
6 | }]
7 | }
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/lodash/_coreJsData.js:
--------------------------------------------------------------------------------
1 | var root = require('./_root');
2 |
3 | /** Used to detect overreaching core-js shims. */
4 | var coreJsData = root['__core-js_shared__'];
5 |
6 | module.exports = coreJsData;
7 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/lodash/_coreJsData.js:
--------------------------------------------------------------------------------
1 | var root = require('./_root');
2 |
3 | /** Used to detect overreaching core-js shims. */
4 | var coreJsData = root['__core-js_shared__'];
5 |
6 | module.exports = coreJsData;
7 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-normal-dep.wxss/import-normal-dep.wxss:
--------------------------------------------------------------------------------
1 | @import './miniprogram_npm/weui-wxss/index.wxss';
2 | @import url('./miniprogram_npm/weui-wxss/dist/style/widget/weui-button/weui-button.wxss');
3 | @import './local-dep/style.wxss';
4 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-special-dep.json/import-special-dep.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | "mp-msg": "weui-miniprogram/msg/msg",
4 | "mp-sticky": "@miniprogram-component-plus/sticky",
5 | "page": "./local-dep/page/page"
6 | }
7 | }
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/checkbox/checkbox.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "mp-cell": "../cell/cell",
5 | "mp-checkbox-group": "../checkbox-group/checkbox-group"
6 | }
7 | }
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/toptips/toptips.wxml:
--------------------------------------------------------------------------------
1 | {{msg}}
2 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-wxss/dist/example/images/layers/transparent.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cong-min/gulp-mp-npm/HEAD/test/expected/unit-test/options-fullExtract/dist/weui-wxss/dist/example/images/layers/transparent.gif
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/checkbox/checkbox.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "mp-cell": "../cell/cell",
5 | "mp-checkbox-group": "../checkbox-group/checkbox-group"
6 | }
7 | }
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/toptips/toptips.wxml:
--------------------------------------------------------------------------------
1 | {{msg}}
2 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/@sindresorhus/slugify/overridable-replacements.js:
--------------------------------------------------------------------------------
1 | const overridableReplacements = [
2 | ['&', ' and '],
3 | ['🦄', ' unicorn '],
4 | ['♥', ' love ']
5 | ];
6 |
7 | export default overridableReplacements;
8 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/lodash/_freeGlobal.js:
--------------------------------------------------------------------------------
1 | /** Detect free variable `global` from Node.js. */
2 | var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
3 |
4 | module.exports = freeGlobal;
5 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-normal-dep.js/miniprogram_npm/lodash/_coreJsData.js:
--------------------------------------------------------------------------------
1 | var root = require('./_root');
2 |
3 | /** Used to detect overreaching core-js shims. */
4 | var coreJsData = root['__core-js_shared__'];
5 |
6 | module.exports = coreJsData;
7 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/@sindresorhus/slugify/overridable-replacements.js:
--------------------------------------------------------------------------------
1 | const overridableReplacements = [
2 | ['&', ' and '],
3 | ['🦄', ' unicorn '],
4 | ['♥', ' love ']
5 | ];
6 |
7 | export default overridableReplacements;
8 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/lodash/_freeGlobal.js:
--------------------------------------------------------------------------------
1 | /** Detect free variable `global` from Node.js. */
2 | var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
3 |
4 | module.exports = freeGlobal;
5 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | temp
2 | coverage
3 | .DS_Store
4 | node_modules
5 |
6 | # Log files
7 | npm-debug.log*
8 | yarn-debug.log*
9 | yarn-error.log*
10 |
11 | # Editor directories and files
12 | .idea
13 | *.suo
14 | *.ntvs*
15 | *.njsproj
16 | *.sln
17 | *.sw*
18 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/import-special-dep.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | "mp-msg": "./dist/weui-miniprogram/msg/msg",
4 | "mp-sticky": "./dist/@miniprogram-component-plus/sticky",
5 | "page": "./local-dep/page/page"
6 | }
7 | }
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-wxss/dist/example/images/layers/transparent.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cong-min/gulp-mp-npm/HEAD/test/expected/integration-test/default/miniprogram_npm/weui-wxss/dist/example/images/layers/transparent.gif
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/import-special-dep.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | "mp-msg": "./dist/weui-miniprogram/msg/msg",
4 | "mp-sticky": "./dist/@miniprogram-component-plus/sticky",
5 | "page": "./local-dep/page/page"
6 | }
7 | }
--------------------------------------------------------------------------------
/test/expected/unit-test/import-normal-dep.js/miniprogram_npm/lodash/_freeGlobal.js:
--------------------------------------------------------------------------------
1 | /** Detect free variable `global` from Node.js. */
2 | var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
3 |
4 | module.exports = freeGlobal;
5 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/cells/cells.wxss:
--------------------------------------------------------------------------------
1 | .weui-cells__group_wxss.weui-cells__group_wxss .weui-cells__title{margin-top:24px}.weui-cells__group_form .weui-cells__tips{margin-top:8px;padding:0 32px;color:var(--weui-FG-1)}
2 |
3 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/cells/cells.wxss:
--------------------------------------------------------------------------------
1 | .weui-cells__group_wxss.weui-cells__group_wxss .weui-cells__title{margin-top:24px}.weui-cells__group_form .weui-cells__tips{margin-top:8px;padding:0 32px;color:var(--weui-FG-1)}
2 |
3 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-deep-scope-dep.js/miniprogram_npm/@sindresorhus/slugify/overridable-replacements.js:
--------------------------------------------------------------------------------
1 | const overridableReplacements = [
2 | ['&', ' and '],
3 | ['🦄', ' unicorn '],
4 | ['♥', ' love ']
5 | ];
6 |
7 | export default overridableReplacements;
8 |
--------------------------------------------------------------------------------
/test/fixtures/integration-test/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 |
4 | # Log files
5 | npm-debug.log*
6 | yarn-debug.log*
7 | yarn-error.log*
8 |
9 | # Editor directories and files
10 | .idea
11 | *.suo
12 | *.ntvs*
13 | *.njsproj
14 | *.sln
15 | *.sw*
16 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/lodash/_nativeCreate.js:
--------------------------------------------------------------------------------
1 | var getNative = require('./_getNative');
2 |
3 | /* Built-in method references that are verified to be native. */
4 | var nativeCreate = getNative(Object, 'create');
5 |
6 | module.exports = nativeCreate;
7 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/lodash/_Map.js:
--------------------------------------------------------------------------------
1 | var getNative = require('./_getNative'),
2 | root = require('./_root');
3 |
4 | /* Built-in method references that are verified to be native. */
5 | var Map = getNative(root, 'Map');
6 |
7 | module.exports = Map;
8 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/lodash/_nativeCreate.js:
--------------------------------------------------------------------------------
1 | var getNative = require('./_getNative');
2 |
3 | /* Built-in method references that are verified to be native. */
4 | var nativeCreate = getNative(Object, 'create');
5 |
6 | module.exports = nativeCreate;
7 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/lodash/_Map.js:
--------------------------------------------------------------------------------
1 | var getNative = require('./_getNative'),
2 | root = require('./_root');
3 |
4 | /* Built-in method references that are verified to be native. */
5 | var Map = getNative(root, 'Map');
6 |
7 | module.exports = Map;
8 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-wxss/dist/example/actionsheet/actionsheet.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * WeUI v2.5.0 (https://github.com/weui/weui-wxss)
3 | * Copyright 2021 Tencent, Inc.
4 | * Licensed under the MIT license
5 | */
6 | .page{background-color:var(--weui-BG-2)}
--------------------------------------------------------------------------------
/test/utils.js:
--------------------------------------------------------------------------------
1 | const normaliseEOL = (str = '', tag) => {
2 | str = str.toString('utf8').replace(/\r\n/g, '\n').trim();
3 | if (tag === 'strict') str = str.replace(/\\r\\n/g, '\\n');
4 | return str;
5 | };
6 |
7 | module.exports = {
8 | normaliseEOL,
9 | };
10 |
--------------------------------------------------------------------------------
/test/fixtures/unit-test/import-normal-dep.js:
--------------------------------------------------------------------------------
1 | import lodash from 'lodash';
2 | import get from 'lodash/get';
3 | import set from 'lodash/set';
4 | import './local-dep/script.js';
5 | export { promisifyAll, promisify } from 'miniprogram-api-promise';
6 | export default { lodash, get, set };
7 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/weui-miniprogram/index.js:
--------------------------------------------------------------------------------
1 | var globalThis=this,self=this;module.exports=require("./_commons/0.js")([{ids:[14],modules:{0:function(s,e,o){s.exports=o(33)},24:function(s,e,o){s.exports=o(0)},33:function(s,e,o){"use strict";o.r(e)}},entries:[[24,0]]}]);
--------------------------------------------------------------------------------
/test/expected/unit-test/import-normal-dep.js/miniprogram_npm/lodash/_Map.js:
--------------------------------------------------------------------------------
1 | var getNative = require('./_getNative'),
2 | root = require('./_root');
3 |
4 | /* Built-in method references that are verified to be native. */
5 | var Map = getNative(root, 'Map');
6 |
7 | module.exports = Map;
8 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-normal-dep.js/miniprogram_npm/lodash/_nativeCreate.js:
--------------------------------------------------------------------------------
1 | var getNative = require('./_getNative');
2 |
3 | /* Built-in method references that are verified to be native. */
4 | var nativeCreate = getNative(Object, 'create');
5 |
6 | module.exports = nativeCreate;
7 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/index.js:
--------------------------------------------------------------------------------
1 | var globalThis=this,self=this;module.exports=require("./_commons/0.js")([{ids:[14],modules:{0:function(s,e,o){s.exports=o(33)},24:function(s,e,o){s.exports=o(0)},33:function(s,e,o){"use strict";o.r(e)}},entries:[[24,0]]}]);
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/index.js:
--------------------------------------------------------------------------------
1 | var globalThis=this,self=this;module.exports=require("./_commons/0.js")([{ids:[14],modules:{0:function(s,e,o){s.exports=o(33)},24:function(s,e,o){s.exports=o(0)},33:function(s,e,o){"use strict";o.r(e)}},entries:[[24,0]]}]);
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/checkbox-group/checkbox-group.wxml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/icon/icon.wxss:
--------------------------------------------------------------------------------
1 | .weui-icon{vertical-align:middle;display:inline-block;background:black;mask-repeat:no-repeat;-webkit-mask-repeat:no-repeat;-moz-mask-repeat:no-repeat;mask-size:cover;-webkit-mask-size:cover;-moz-mask-size:cover}
2 |
3 |
--------------------------------------------------------------------------------
/test/expected/unit-test/require-dep.js/miniprogram_npm/weui-miniprogram/index.js:
--------------------------------------------------------------------------------
1 | var globalThis=this,self=this;module.exports=require("./_commons/0.js")([{ids:[14],modules:{0:function(s,e,o){s.exports=o(33)},24:function(s,e,o){s.exports=o(0)},33:function(s,e,o){"use strict";o.r(e)}},entries:[[24,0]]}]);
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/checkbox-group/checkbox-group.wxml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/icon/icon.wxss:
--------------------------------------------------------------------------------
1 | .weui-icon{vertical-align:middle;display:inline-block;background:black;mask-repeat:no-repeat;-webkit-mask-repeat:no-repeat;-moz-mask-repeat:no-repeat;mask-size:cover;-webkit-mask-size:cover;-moz-mask-size:cover}
2 |
3 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-special-dep.js/miniprogram_npm/weui-miniprogram/index.js:
--------------------------------------------------------------------------------
1 | var globalThis=this,self=this;module.exports=require("./_commons/0.js")([{ids:[14],modules:{0:function(s,e,o){s.exports=o(33)},24:function(s,e,o){s.exports=o(0)},33:function(s,e,o){"use strict";o.r(e)}},entries:[[24,0]]}]);
--------------------------------------------------------------------------------
/test/expected/unit-test/import-normal-dep.js/import-normal-dep.js:
--------------------------------------------------------------------------------
1 | import lodash from 'lodash';
2 | import get from 'lodash/get';
3 | import set from 'lodash/set';
4 | import './local-dep/script.js';
5 | export { promisifyAll, promisify } from 'miniprogram-api-promise';
6 | export default { lodash, get, set };
7 |
--------------------------------------------------------------------------------
/test/fixtures/integration-test/src/components/quickstart/quickstart.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | $ npm start
5 |
6 | $ npm run build
7 |
8 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/components/quickstart/quickstart.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | $ npm start
5 |
6 | $ npm run build
7 |
8 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/pages/index/index.wxss.map:
--------------------------------------------------------------------------------
1 | {"version":3,"sources":["pages/index/index.less"],"names":[],"mappings":";AACA,SACI;EACI,aAAA;EACA,cAAA","sourcesContent":["/* index.less */\n.main-msg {\n .weui-msg__icon-img {\n width: 250rpx;\n height: 250rpx;\n }\n}\n"],"file":"index.wxss"}
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | charset = utf-8
5 | indent_style = space
6 | indent_size = 4
7 | end_of_line = lf
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
11 | [*.{js,jsx,ts,tsx,vue}]
12 | max_line_length = 100
13 |
14 | [*.{json,yml}]
15 | indent_style = space
16 | indent_size = 2
17 |
--------------------------------------------------------------------------------
/test/expected/integration-test/customize-npmDirname/components/quickstart/quickstart.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | $ npm start
5 |
6 | $ npm run build
7 |
8 |
--------------------------------------------------------------------------------
/test/expected/integration-test/customize-npmDirname/pages/index/index.wxss.map:
--------------------------------------------------------------------------------
1 | {"version":3,"sources":["pages/index/index.less"],"names":[],"mappings":";AACA,SACI;EACI,aAAA;EACA,cAAA","sourcesContent":["/* index.less */\n.main-msg {\n .weui-msg__icon-img {\n width: 250rpx;\n height: 250rpx;\n }\n}\n"],"file":"index.wxss"}
--------------------------------------------------------------------------------
/test/fixtures/integration-test/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | extends: [ ],
3 | globals: {
4 | 'wx': false,
5 | 'App': false,
6 | 'getApp': false,
7 | 'Page': false,
8 | 'getCurrentPages': false,
9 | 'Component': false,
10 | 'Behavior': false,
11 | },
12 | };
13 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-wxs-dep.json/miniprogram_npm/@vant/weapp/wxs/utils.wxs:
--------------------------------------------------------------------------------
1 | /* eslint-disable */
2 | var bem = require('./bem.wxs');
3 | var memoize = require('./memoize.wxs');
4 | var addUnit = require('./add-unit.wxs');
5 |
6 | module.exports = {
7 | bem: memoize(bem),
8 | memoize: memoize,
9 | addUnit: addUnit
10 | };
11 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/lodash/_listCacheClear.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Removes all key-value entries from the list cache.
3 | *
4 | * @private
5 | * @name clear
6 | * @memberOf ListCache
7 | */
8 | function listCacheClear() {
9 | this.__data__ = [];
10 | this.size = 0;
11 | }
12 |
13 | module.exports = listCacheClear;
14 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/lodash/_listCacheClear.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Removes all key-value entries from the list cache.
3 | *
4 | * @private
5 | * @name clear
6 | * @memberOf ListCache
7 | */
8 | function listCacheClear() {
9 | this.__data__ = [];
10 | this.size = 0;
11 | }
12 |
13 | module.exports = listCacheClear;
14 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/lodash/_defineProperty.js:
--------------------------------------------------------------------------------
1 | var getNative = require('./_getNative');
2 |
3 | var defineProperty = (function() {
4 | try {
5 | var func = getNative(Object, 'defineProperty');
6 | func({}, '', {});
7 | return func;
8 | } catch (e) {}
9 | }());
10 |
11 | module.exports = defineProperty;
12 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/app.wxss.map:
--------------------------------------------------------------------------------
1 | {"version":3,"sources":["app.less"],"names":[],"mappings":";QACc;AAEd;EACI,aAAA;EACA,sBAAA;EACA,oBAAA","sourcesContent":["/* app.less **/\n@import (css) 'weui-miniprogram/weui-wxss/dist/style/weui.wxss';\n\npage {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n}\n"],"file":"app.wxss"}
--------------------------------------------------------------------------------
/test/expected/integration-test/default/utils/index.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"sources":["utils/index.ts"],"names":[],"mappings":";;;AAAA,mEAAkE;AAAzD,uHAAA,YAAY,OAAA;AAAE,oHAAA,SAAS,OAAA;AAChC,6BAAwB;AACf,eADF,cAAI,CACE","file":"index.js","sourcesContent":["export { promisifyAll, promisify } from 'miniprogram-api-promise';\nimport mitt from 'mitt';\nexport { mitt };\n"]}
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/lodash/_defineProperty.js:
--------------------------------------------------------------------------------
1 | var getNative = require('./_getNative');
2 |
3 | var defineProperty = (function() {
4 | try {
5 | var func = getNative(Object, 'defineProperty');
6 | func({}, '', {});
7 | return func;
8 | } catch (e) {}
9 | }());
10 |
11 | module.exports = defineProperty;
12 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/import-normal-dep.js:
--------------------------------------------------------------------------------
1 | import lodash from './dist/lodash/lodash.js';
2 | import get from './dist/lodash/get';
3 | import set from './dist/lodash/set';
4 | import './local-dep/script.js';
5 | export { promisifyAll, promisify } from './dist/miniprogram-api-promise/src/index.js';
6 | export default { lodash, get, set };
7 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/badge/badge.js:
--------------------------------------------------------------------------------
1 | var globalThis=this,self=this;module.exports=require("../_commons/0.js")([{ids:[2],modules:{11:function(e,s,t){e.exports=t(117)},117:function(e,s){Component({options:{addGlobalClass:!0},properties:{extClass:{type:String,value:""},content:{type:String,value:""}}})}},entries:[[11,0]]}]);
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/import-normal-dep.js:
--------------------------------------------------------------------------------
1 | import lodash from './dist/lodash/lodash.js';
2 | import get from './dist/lodash/get';
3 | import set from './dist/lodash/set';
4 | import './local-dep/script.js';
5 | export { promisifyAll, promisify } from './dist/miniprogram-api-promise/src/index.js';
6 | export default { lodash, get, set };
7 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/badge/badge.js:
--------------------------------------------------------------------------------
1 | var globalThis=this,self=this;module.exports=require("../_commons/0.js")([{ids:[2],modules:{11:function(e,s,t){e.exports=t(117)},117:function(e,s){Component({options:{addGlobalClass:!0},properties:{extClass:{type:String,value:""},content:{type:String,value:""}}})}},entries:[[11,0]]}]);
--------------------------------------------------------------------------------
/test/expected/unit-test/import-normal-dep.js/miniprogram_npm/lodash/_listCacheClear.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Removes all key-value entries from the list cache.
3 | *
4 | * @private
5 | * @name clear
6 | * @memberOf ListCache
7 | */
8 | function listCacheClear() {
9 | this.__data__ = [];
10 | this.size = 0;
11 | }
12 |
13 | module.exports = listCacheClear;
14 |
--------------------------------------------------------------------------------
/test/fixtures/integration-test/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | charset = utf-8
5 | indent_style = space
6 | indent_size = 4
7 | end_of_line = lf
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
11 | [*.{js,jsx,ts,tsx,vue}]
12 | max_line_length = 100
13 |
14 | [*.{json,yml}]
15 | indent_style = space
16 | indent_size = 2
17 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-normal-dep.js/miniprogram_npm/lodash/_defineProperty.js:
--------------------------------------------------------------------------------
1 | var getNative = require('./_getNative');
2 |
3 | var defineProperty = (function() {
4 | try {
5 | var func = getNative(Object, 'defineProperty');
6 | func({}, '', {});
7 | return func;
8 | } catch (e) {}
9 | }());
10 |
11 | module.exports = defineProperty;
12 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-wxs-dep.json/miniprogram_npm/@vant/weapp/wxs/add-unit.wxs:
--------------------------------------------------------------------------------
1 | /* eslint-disable */
2 | var REGEXP = getRegExp('^-?\d+(\.\d+)?$');
3 |
4 | function addUnit(value) {
5 | if (value == null) {
6 | return undefined;
7 | }
8 |
9 | return REGEXP.test('' + value) ? value + 'px' : value;
10 | }
11 |
12 | module.exports = addUnit;
13 |
--------------------------------------------------------------------------------
/test/expected/integration-test/customize-npmDirname/app.wxss.map:
--------------------------------------------------------------------------------
1 | {"version":3,"sources":["app.less"],"names":[],"mappings":";QACc;AAEd;EACI,aAAA;EACA,sBAAA;EACA,oBAAA","sourcesContent":["/* app.less **/\n@import (css) 'weui-miniprogram/weui-wxss/dist/style/weui.wxss';\n\npage {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n}\n"],"file":"app.wxss"}
--------------------------------------------------------------------------------
/test/expected/integration-test/customize-npmDirname/utils/index.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"sources":["utils/index.ts"],"names":[],"mappings":";;;AAAA,mEAAkE;AAAzD,uHAAA,YAAY,OAAA;AAAE,oHAAA,SAAS,OAAA;AAChC,6BAAwB;AACf,eADF,cAAI,CACE","file":"index.js","sourcesContent":["export { promisifyAll, promisify } from 'miniprogram-api-promise';\nimport mitt from 'mitt';\nexport { mitt };\n"]}
--------------------------------------------------------------------------------
/test/fixtures/integration-test/src/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "pages": [
3 | "pages/index/index"
4 | ],
5 | "window": {
6 | "backgroundTextStyle": "light",
7 | "navigationBarBackgroundColor": "#fff",
8 | "navigationBarTitleText": "Gulp Template",
9 | "navigationBarTextStyle": "black"
10 | },
11 | "style": "v2",
12 | "sitemapLocation": "sitemap.json"
13 | }
--------------------------------------------------------------------------------
/test/expected/integration-test/default/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "pages": [
3 | "pages/index/index"
4 | ],
5 | "window": {
6 | "backgroundTextStyle": "light",
7 | "navigationBarBackgroundColor": "#fff",
8 | "navigationBarTitleText": "Gulp Template",
9 | "navigationBarTextStyle": "black"
10 | },
11 | "style": "v2",
12 | "sitemapLocation": "sitemap.json"
13 | }
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/@miniprogram-component-plus/sticky/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/lib/utils/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Convert Windows backslash paths to slash paths: foo\\bar ➔ foo/bar
3 | *
4 | * @param path
5 | * @return slashed path
6 | */
7 | exports.slash = (path) => {
8 | const isExtendedLengthPath = /^\\\\\?\\/.test(path);
9 |
10 | if (isExtendedLengthPath) {
11 | return path;
12 | }
13 |
14 | return path.replace(/\\/g, '/');
15 | };
16 |
--------------------------------------------------------------------------------
/test/expected/integration-test/customize-npmDirname/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "pages": [
3 | "pages/index/index"
4 | ],
5 | "window": {
6 | "backgroundTextStyle": "light",
7 | "navigationBarBackgroundColor": "#fff",
8 | "navigationBarTitleText": "Gulp Template",
9 | "navigationBarTextStyle": "black"
10 | },
11 | "style": "v2",
12 | "sitemapLocation": "sitemap.json"
13 | }
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/@miniprogram-component-plus/sticky/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-wxs-dep.json/miniprogram_npm/@vant/weapp/wxs/object.wxs:
--------------------------------------------------------------------------------
1 | /* eslint-disable */
2 | var REGEXP = getRegExp('{|}|"', 'g');
3 |
4 | function keys(obj) {
5 | return JSON.stringify(obj)
6 | .replace(REGEXP, '')
7 | .split(',')
8 | .map(function(item) {
9 | return item.split(':')[0];
10 | });
11 | }
12 |
13 | module.exports.keys = keys;
14 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/lodash/_root.js:
--------------------------------------------------------------------------------
1 | var freeGlobal = require('./_freeGlobal');
2 |
3 | /** Detect free variable `self`. */
4 | var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
5 |
6 | /** Used as a reference to the global object. */
7 | var root = freeGlobal || freeSelf || Function('return this')();
8 |
9 | module.exports = root;
10 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-special-dep.json/miniprogram_npm/@miniprogram-component-plus/sticky/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/lodash/_root.js:
--------------------------------------------------------------------------------
1 | var freeGlobal = require('./_freeGlobal');
2 |
3 | /** Detect free variable `self`. */
4 | var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
5 |
6 | /** Used as a reference to the global object. */
7 | var root = freeGlobal || freeSelf || Function('return this')();
8 |
9 | module.exports = root;
10 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/toptips/toptips.wxss:
--------------------------------------------------------------------------------
1 | .weui-toptips_show.weui-toptips{display:block}.weui-toptips_show{-webkit-transform:translateZ(0) translateY(0);transform:translateZ(0) translateY(0);opacity:1}.weui-toptips_success{background-color:var(--weui-BRAND)}.weui-toptips_error{background-color:var(--weui-RED)}.weui-toptips_info{background-color:var(--weui-BLUE)}
2 |
3 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-normal-dep.js/miniprogram_npm/lodash/_root.js:
--------------------------------------------------------------------------------
1 | var freeGlobal = require('./_freeGlobal');
2 |
3 | /** Detect free variable `self`. */
4 | var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
5 |
6 | /** Used as a reference to the global object. */
7 | var root = freeGlobal || freeSelf || Function('return this')();
8 |
9 | module.exports = root;
10 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/mitt/dist/mitt.js:
--------------------------------------------------------------------------------
1 | module.exports=function(n){return{all:n=n||new Map,on:function(e,t){var i=n.get(e);i?i.push(t):n.set(e,[t])},off:function(e,t){var i=n.get(e);i&&(t?i.splice(i.indexOf(t)>>>0,1):n.set(e,[]))},emit:function(e,t){var i=n.get(e);i&&i.slice().map(function(n){n(t)}),(i=n.get("*"))&&i.slice().map(function(n){n(e,t)})}}};
2 | //# sourceMappingURL=mitt.js.map
3 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/mitt/index.js:
--------------------------------------------------------------------------------
1 | module.exports=function(n){return{all:n=n||new Map,on:function(e,t){var i=n.get(e);i?i.push(t):n.set(e,[t])},off:function(e,t){var i=n.get(e);i&&(t?i.splice(i.indexOf(t)>>>0,1):n.set(e,[]))},emit:function(e,t){var i=n.get(e);i&&i.slice().map(function(n){n(t)}),(i=n.get("*"))&&i.slice().map(function(n){n(e,t)})}}};
2 | //# sourceMappingURL=mitt.js.map
3 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/toptips/toptips.wxss:
--------------------------------------------------------------------------------
1 | .weui-toptips_show.weui-toptips{display:block}.weui-toptips_show{-webkit-transform:translateZ(0) translateY(0);transform:translateZ(0) translateY(0);opacity:1}.weui-toptips_success{background-color:var(--weui-BRAND)}.weui-toptips_error{background-color:var(--weui-RED)}.weui-toptips_info{background-color:var(--weui-BLUE)}
2 |
3 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/lodash/_hashClear.js:
--------------------------------------------------------------------------------
1 | var nativeCreate = require('./_nativeCreate');
2 |
3 | /**
4 | * Removes all key-value entries from the hash.
5 | *
6 | * @private
7 | * @name clear
8 | * @memberOf Hash
9 | */
10 | function hashClear() {
11 | this.__data__ = nativeCreate ? nativeCreate(null) : {};
12 | this.size = 0;
13 | }
14 |
15 | module.exports = hashClear;
16 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/lodash/_hashClear.js:
--------------------------------------------------------------------------------
1 | var nativeCreate = require('./_nativeCreate');
2 |
3 | /**
4 | * Removes all key-value entries from the hash.
5 | *
6 | * @private
7 | * @name clear
8 | * @memberOf Hash
9 | */
10 | function hashClear() {
11 | this.__data__ = nativeCreate ? nativeCreate(null) : {};
12 | this.size = 0;
13 | }
14 |
15 | module.exports = hashClear;
16 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/mitt/dist/mitt.mjs:
--------------------------------------------------------------------------------
1 | export default function(n){return{all:n=n||new Map,on:function(t,e){var i=n.get(t);i?i.push(e):n.set(t,[e])},off:function(t,e){var i=n.get(t);i&&(e?i.splice(i.indexOf(e)>>>0,1):n.set(t,[]))},emit:function(t,e){var i=n.get(t);i&&i.slice().map(function(n){n(e)}),(i=n.get("*"))&&i.slice().map(function(n){n(t,e)})}}}
2 | //# sourceMappingURL=mitt.mjs.map
3 |
--------------------------------------------------------------------------------
/test/expected/integration-test/customize-npmDirname/dist/mitt/dist/mitt.js:
--------------------------------------------------------------------------------
1 | module.exports=function(n){return{all:n=n||new Map,on:function(e,t){var i=n.get(e);i?i.push(t):n.set(e,[t])},off:function(e,t){var i=n.get(e);i&&(t?i.splice(i.indexOf(t)>>>0,1):n.set(e,[]))},emit:function(e,t){var i=n.get(e);i&&i.slice().map(function(n){n(t)}),(i=n.get("*"))&&i.slice().map(function(n){n(e,t)})}}};
2 | //# sourceMappingURL=mitt.js.map
3 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/loading/loading.wxss:
--------------------------------------------------------------------------------
1 | .wx_loading_view{display:flex;justify-content:center;align-items:center;overflow:hidden}.wx_loading_view__hide{height:0!important;display:none}.wx_loading_view__animated.wx_loading_view__hide{display:flex}.loading{color:rgba(255,255,255,0.9);font-size:17px;text-align:center}.loading_view_translation{transition:height 0.2s 0.3s ease}
2 |
3 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/loading/loading.wxss:
--------------------------------------------------------------------------------
1 | .wx_loading_view{display:flex;justify-content:center;align-items:center;overflow:hidden}.wx_loading_view__hide{height:0!important;display:none}.wx_loading_view__animated.wx_loading_view__hide{display:flex}.loading{color:rgba(255,255,255,0.9);font-size:17px;text-align:center}.loading_view_translation{transition:height 0.2s 0.3s ease}
2 |
3 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-normal-dep.js/miniprogram_npm/lodash/_hashClear.js:
--------------------------------------------------------------------------------
1 | var nativeCreate = require('./_nativeCreate');
2 |
3 | /**
4 | * Removes all key-value entries from the hash.
5 | *
6 | * @private
7 | * @name clear
8 | * @memberOf Hash
9 | */
10 | function hashClear() {
11 | this.__data__ = nativeCreate ? nativeCreate(null) : {};
12 | this.size = 0;
13 | }
14 |
15 | module.exports = hashClear;
16 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/dialog/dialog.wxss:
--------------------------------------------------------------------------------
1 | .weui-dialog.weui-dialog_hidden{opacity:0;transform:scale3d(1,1,0)}.weui-dialog{opacity:1;-webkit-transform:scale3d(1,1,1) translateY(-50%);transform:scale3d(1,1,1) translateY(-50%);transition:all 0.2s ease-in}.weui-mask.weui-mask_hidden{opacity:0;transform:scale3d(1,1,0)}.weui-mask{opacity:1;transform:scale3d(1,1,1);transition:all 0.2s ease-in}
2 |
3 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/dialog/dialog.wxss:
--------------------------------------------------------------------------------
1 | .weui-dialog.weui-dialog_hidden{opacity:0;transform:scale3d(1,1,0)}.weui-dialog{opacity:1;-webkit-transform:scale3d(1,1,1) translateY(-50%);transform:scale3d(1,1,1) translateY(-50%);transition:all 0.2s ease-in}.weui-mask.weui-mask_hidden{opacity:0;transform:scale3d(1,1,0)}.weui-mask{opacity:1;transform:scale3d(1,1,1);transition:all 0.2s ease-in}
2 |
3 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/half-screen-dialog/half-screen-dialog.wxss:
--------------------------------------------------------------------------------
1 | .weui-mask,
2 | .weui-half-screen-dialog{transition:all 0.3s}.weui-hidden .weui-mask{visibility:hidden;opacity:0}.weui-hidden .weui-half-screen-dialog{transform:translateY(100%)}.weui-show .weui-mask{opacity:1;visibility:visible}.weui-show .weui-half-screen-dialog{transform:translateY(0%)}.weui-half-screen-dialog__ft{display:flex}
3 |
4 |
--------------------------------------------------------------------------------
/lib/utils/getNodeModulesPath.js:
--------------------------------------------------------------------------------
1 | // 通过路径解析所在的 node_modules 文件夹路径
2 | const path = require('path');
3 | const { slash } = require('./index');
4 |
5 | module.exports = (filepath = '') => {
6 | const separator = '/node_modules/';
7 | const pathSplit = slash(filepath).split(separator);
8 | if (pathSplit.length === 1) return '';
9 | pathSplit.pop();
10 | return path.posix.join(pathSplit.join(separator), separator);
11 | };
12 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/half-screen-dialog/half-screen-dialog.wxss:
--------------------------------------------------------------------------------
1 | .weui-mask,
2 | .weui-half-screen-dialog{transition:all 0.3s}.weui-hidden .weui-mask{visibility:hidden;opacity:0}.weui-hidden .weui-half-screen-dialog{transform:translateY(100%)}.weui-show .weui-mask{opacity:1;visibility:visible}.weui-show .weui-half-screen-dialog{transform:translateY(0%)}.weui-half-screen-dialog__ft{display:flex}
3 |
4 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/lodash/_getValue.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Gets the value at `key` of `object`.
3 | *
4 | * @private
5 | * @param {Object} [object] The object to query.
6 | * @param {string} key The key of the property to get.
7 | * @returns {*} Returns the property value.
8 | */
9 | function getValue(object, key) {
10 | return object == null ? undefined : object[key];
11 | }
12 |
13 | module.exports = getValue;
14 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/lodash/_getValue.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Gets the value at `key` of `object`.
3 | *
4 | * @private
5 | * @param {Object} [object] The object to query.
6 | * @param {string} key The key of the property to get.
7 | * @returns {*} Returns the property value.
8 | */
9 | function getValue(object, key) {
10 | return object == null ? undefined : object[key];
11 | }
12 |
13 | module.exports = getValue;
14 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/cells/cells.wxml:
--------------------------------------------------------------------------------
1 | {{title}}{{footer}}
2 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/cells/cells.wxml:
--------------------------------------------------------------------------------
1 | {{title}}{{footer}}
2 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-normal-dep.js/miniprogram_npm/lodash/_getValue.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Gets the value at `key` of `object`.
3 | *
4 | * @private
5 | * @param {Object} [object] The object to query.
6 | * @param {string} key The key of the property to get.
7 | * @returns {*} Returns the property value.
8 | */
9 | function getValue(object, key) {
10 | return object == null ? undefined : object[key];
11 | }
12 |
13 | module.exports = getValue;
14 |
--------------------------------------------------------------------------------
/test/fixtures/integration-test/README.md:
--------------------------------------------------------------------------------
1 | # 微信小程序 gulp 模板
2 |
3 | > - 🚀 轻量极速构建
4 | > - 🧰 支持 `TypeScript` `Less`
5 | > - 🗃 按需提取 npm 依赖
6 | > - 🎡 支持提取小程序 npm 包组件
7 | > - 🌁 图片压缩
8 |
9 | ## 快速开始
10 |
11 | ```bash
12 | # 启动监听服务
13 | $ npm start
14 | # 单次构建
15 | $ npm run build
16 | ```
17 |
18 | 将整个项目目录添加至微信开发者工具中,其中 `src` 为开发路径,`.miniprogram` 为生产路径。
19 |
20 | ---
21 |
22 | > 创建自 [mp-gulpfile](https://github.com/mcc108/mp-gulpfile) 微信小程序 gulpfile 最佳实践
23 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/lodash/_mapCacheGet.js:
--------------------------------------------------------------------------------
1 | var getMapData = require('./_getMapData');
2 |
3 | /**
4 | * Gets the map value for `key`.
5 | *
6 | * @private
7 | * @name get
8 | * @memberOf MapCache
9 | * @param {string} key The key of the value to get.
10 | * @returns {*} Returns the entry value.
11 | */
12 | function mapCacheGet(key) {
13 | return getMapData(this, key).get(key);
14 | }
15 |
16 | module.exports = mapCacheGet;
17 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/lodash/_mapCacheGet.js:
--------------------------------------------------------------------------------
1 | var getMapData = require('./_getMapData');
2 |
3 | /**
4 | * Gets the map value for `key`.
5 | *
6 | * @private
7 | * @name get
8 | * @memberOf MapCache
9 | * @param {string} key The key of the value to get.
10 | * @returns {*} Returns the entry value.
11 | */
12 | function mapCacheGet(key) {
13 | return getMapData(this, key).get(key);
14 | }
15 |
16 | module.exports = mapCacheGet;
17 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-normal-dep.js/miniprogram_npm/lodash/_mapCacheGet.js:
--------------------------------------------------------------------------------
1 | var getMapData = require('./_getMapData');
2 |
3 | /**
4 | * Gets the map value for `key`.
5 | *
6 | * @private
7 | * @name get
8 | * @memberOf MapCache
9 | * @param {string} key The key of the value to get.
10 | * @returns {*} Returns the entry value.
11 | */
12 | function mapCacheGet(key) {
13 | return getMapData(this, key).get(key);
14 | }
15 |
16 | module.exports = mapCacheGet;
17 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/msg/msg.js:
--------------------------------------------------------------------------------
1 | var globalThis=this,self=this;module.exports=require("../_commons/0.js")([{ids:[16],modules:{14:function(e,t,s){e.exports=s(141)},141:function(e,t){Component({options:{addGlobalClass:!0,multipleSlots:!0},properties:{title:{type:String,value:""},type:{type:String,value:""},icon:{type:String,value:""},desc:{type:String,value:""},extClass:{type:String,value:""},size:{type:Number,value:64}},data:{}})}},entries:[[14,0]]}]);
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/weui-miniprogram/loading/loading.js:
--------------------------------------------------------------------------------
1 | var globalThis=this,self=this;module.exports=require("../_commons/0.js")([{ids:[15],modules:{101:function(e,t){Component({options:{addGlobalClass:!0},properties:{extClass:{type:String,value:""},show:{type:Boolean,value:!0},animated:{type:Boolean,value:!1},duration:{type:Number,value:350},type:{type:String,value:"dot-gray"},tips:{type:String,value:"加载中"}}})},9:function(e,t,o){e.exports=o(101)}},entries:[[9,0]]}]);
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/weui-miniprogram/msg/msg.js:
--------------------------------------------------------------------------------
1 | var globalThis=this,self=this;module.exports=require("../_commons/0.js")([{ids:[16],modules:{14:function(e,t,s){e.exports=s(141)},141:function(e,t){Component({options:{addGlobalClass:!0,multipleSlots:!0},properties:{title:{type:String,value:""},type:{type:String,value:""},icon:{type:String,value:""},desc:{type:String,value:""},extClass:{type:String,value:""},size:{type:Number,value:64}},data:{}})}},entries:[[14,0]]}]);
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/loading/loading.js:
--------------------------------------------------------------------------------
1 | var globalThis=this,self=this;module.exports=require("../_commons/0.js")([{ids:[15],modules:{101:function(e,t){Component({options:{addGlobalClass:!0},properties:{extClass:{type:String,value:""},show:{type:Boolean,value:!0},animated:{type:Boolean,value:!1},duration:{type:Number,value:350},type:{type:String,value:"dot-gray"},tips:{type:String,value:"加载中"}}})},9:function(e,t,o){e.exports=o(101)}},entries:[[9,0]]}]);
--------------------------------------------------------------------------------
/test/expected/integration-test/customize-npmDirname/dist/weui-miniprogram/msg/msg.js:
--------------------------------------------------------------------------------
1 | var globalThis=this,self=this;module.exports=require("../_commons/0.js")([{ids:[16],modules:{14:function(e,t,s){e.exports=s(141)},141:function(e,t){Component({options:{addGlobalClass:!0,multipleSlots:!0},properties:{title:{type:String,value:""},type:{type:String,value:""},icon:{type:String,value:""},desc:{type:String,value:""},extClass:{type:String,value:""},size:{type:Number,value:64}},data:{}})}},entries:[[14,0]]}]);
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/loading/loading.js:
--------------------------------------------------------------------------------
1 | var globalThis=this,self=this;module.exports=require("../_commons/0.js")([{ids:[15],modules:{101:function(e,t){Component({options:{addGlobalClass:!0},properties:{extClass:{type:String,value:""},show:{type:Boolean,value:!0},animated:{type:Boolean,value:!1},duration:{type:Number,value:350},type:{type:String,value:"dot-gray"},tips:{type:String,value:"加载中"}}})},9:function(e,t,o){e.exports=o(101)}},entries:[[9,0]]}]);
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/msg/msg.js:
--------------------------------------------------------------------------------
1 | var globalThis=this,self=this;module.exports=require("../_commons/0.js")([{ids:[16],modules:{14:function(e,t,s){e.exports=s(141)},141:function(e,t){Component({options:{addGlobalClass:!0,multipleSlots:!0},properties:{title:{type:String,value:""},type:{type:String,value:""},icon:{type:String,value:""},desc:{type:String,value:""},extClass:{type:String,value:""},size:{type:Number,value:64}},data:{}})}},entries:[[14,0]]}]);
--------------------------------------------------------------------------------
/test/expected/unit-test/import-special-dep.js/miniprogram_npm/weui-miniprogram/loading/loading.js:
--------------------------------------------------------------------------------
1 | var globalThis=this,self=this;module.exports=require("../_commons/0.js")([{ids:[15],modules:{101:function(e,t){Component({options:{addGlobalClass:!0},properties:{extClass:{type:String,value:""},show:{type:Boolean,value:!0},animated:{type:Boolean,value:!1},duration:{type:Number,value:350},type:{type:String,value:"dot-gray"},tips:{type:String,value:"加载中"}}})},9:function(e,t,o){e.exports=o(101)}},entries:[[9,0]]}]);
--------------------------------------------------------------------------------
/test/expected/unit-test/import-special-dep.json/miniprogram_npm/weui-miniprogram/msg/msg.js:
--------------------------------------------------------------------------------
1 | var globalThis=this,self=this;module.exports=require("../_commons/0.js")([{ids:[16],modules:{14:function(e,t,s){e.exports=s(141)},141:function(e,t){Component({options:{addGlobalClass:!0,multipleSlots:!0},properties:{title:{type:String,value:""},type:{type:String,value:""},icon:{type:String,value:""},desc:{type:String,value:""},extClass:{type:String,value:""},size:{type:Number,value:64}},data:{}})}},entries:[[14,0]]}]);
--------------------------------------------------------------------------------
/test/expected/integration-test/default/components/quickstart/quickstart.wxss:
--------------------------------------------------------------------------------
1 | .pre {
2 | width: 520rpx;
3 | margin: 0 auto;
4 | padding: 40rpx 50rpx;
5 | border-radius: 10rpx;
6 | background-color: #eee;
7 | font-size: 14px;
8 | font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
9 | line-height: 1.5;
10 | text-align: left;
11 | display: flex;
12 | flex-direction: column;
13 | }
14 | .code {
15 | color: #222;
16 | }
17 | .comment {
18 | color: #999;
19 | }
20 |
--------------------------------------------------------------------------------
/test/expected/integration-test/customize-npmDirname/components/quickstart/quickstart.wxss:
--------------------------------------------------------------------------------
1 | .pre {
2 | width: 520rpx;
3 | margin: 0 auto;
4 | padding: 40rpx 50rpx;
5 | border-radius: 10rpx;
6 | background-color: #eee;
7 | font-size: 14px;
8 | font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
9 | line-height: 1.5;
10 | text-align: left;
11 | display: flex;
12 | flex-direction: column;
13 | }
14 | .code {
15 | color: #222;
16 | }
17 | .comment {
18 | color: #999;
19 | }
20 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/lodash/_mapCacheHas.js:
--------------------------------------------------------------------------------
1 | var getMapData = require('./_getMapData');
2 |
3 | /**
4 | * Checks if a map value for `key` exists.
5 | *
6 | * @private
7 | * @name has
8 | * @memberOf MapCache
9 | * @param {string} key The key of the entry to check.
10 | * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
11 | */
12 | function mapCacheHas(key) {
13 | return getMapData(this, key).has(key);
14 | }
15 |
16 | module.exports = mapCacheHas;
17 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/lodash/_mapCacheHas.js:
--------------------------------------------------------------------------------
1 | var getMapData = require('./_getMapData');
2 |
3 | /**
4 | * Checks if a map value for `key` exists.
5 | *
6 | * @private
7 | * @name has
8 | * @memberOf MapCache
9 | * @param {string} key The key of the entry to check.
10 | * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
11 | */
12 | function mapCacheHas(key) {
13 | return getMapData(this, key).has(key);
14 | }
15 |
16 | module.exports = mapCacheHas;
17 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-normal-dep.js/miniprogram_npm/lodash/_mapCacheHas.js:
--------------------------------------------------------------------------------
1 | var getMapData = require('./_getMapData');
2 |
3 | /**
4 | * Checks if a map value for `key` exists.
5 | *
6 | * @private
7 | * @name has
8 | * @memberOf MapCache
9 | * @param {string} key The key of the entry to check.
10 | * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
11 | */
12 | function mapCacheHas(key) {
13 | return getMapData(this, key).has(key);
14 | }
15 |
16 | module.exports = mapCacheHas;
17 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-wxss/dist/mixin/themeChanged.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | data: {
3 | theme: '',
4 | },
5 | themeChanged(theme) {
6 | this.setData({
7 | theme,
8 | });
9 | },
10 | onLoad() {
11 | const app = getApp();
12 | this.themeChanged(app.globalData.theme);
13 | app.watchThemeChange(this.themeChanged);
14 | },
15 | onUnload() {
16 | getApp().unWatchThemeChange(this.themeChanged);
17 | },
18 | };
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/@miniprogram-component-plus/sticky/index.wxs:
--------------------------------------------------------------------------------
1 |
2 | /* eslint-disable */
3 | function wrapStyle(data) {
4 | if (data.fixed) {
5 | return 'top: ' + data.offsetTop + 'px;'
6 | }
7 | return ''
8 | }
9 |
10 | function containerStyle(data) {
11 | if (data.fixed) {
12 | return 'height: ' + data.height + 'px; z-index: ' + data.zIndex + ';'
13 | }
14 | return ''
15 | }
16 |
17 | module.exports = {
18 | wrapStyle: wrapStyle,
19 | containerStyle: containerStyle
20 | }
21 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/@miniprogram-component-plus/sticky/index.wxs:
--------------------------------------------------------------------------------
1 |
2 | /* eslint-disable */
3 | function wrapStyle(data) {
4 | if (data.fixed) {
5 | return 'top: ' + data.offsetTop + 'px;'
6 | }
7 | return ''
8 | }
9 |
10 | function containerStyle(data) {
11 | if (data.fixed) {
12 | return 'height: ' + data.height + 'px; z-index: ' + data.zIndex + ';'
13 | }
14 | return ''
15 | }
16 |
17 | module.exports = {
18 | wrapStyle: wrapStyle,
19 | containerStyle: containerStyle
20 | }
21 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/app.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Object.defineProperty(exports, "__esModule", { value: true });
3 | var index_1 = require("./utils/index");
4 | App({
5 | onLaunch: function (options) {
6 | console.log('onLaunch options', options);
7 | },
8 | onShow: function () { },
9 | onHide: function () { },
10 | onError: function () { },
11 | onPageNotFound: function () { },
12 | globalData: {},
13 | emitter: (0, index_1.mitt)(),
14 | });
15 |
16 | //# sourceMappingURL=app.js.map
17 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/pages/index/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Page({
3 | data: {
4 | start: false,
5 | },
6 | onLoad: function (query) {
7 | console.log('onLoad query', query);
8 | },
9 | onShow: function () { },
10 | onReady: function () { },
11 | onHide: function () { },
12 | onUnload: function () { },
13 | quickstart: function () {
14 | this.setData({
15 | start: true,
16 | });
17 | }
18 | });
19 |
20 | //# sourceMappingURL=index.js.map
21 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/lodash/_listCacheHas.js:
--------------------------------------------------------------------------------
1 | var assocIndexOf = require('./_assocIndexOf');
2 |
3 | /**
4 | * Checks if a list cache value for `key` exists.
5 | *
6 | * @private
7 | * @name has
8 | * @memberOf ListCache
9 | * @param {string} key The key of the entry to check.
10 | * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
11 | */
12 | function listCacheHas(key) {
13 | return assocIndexOf(this.__data__, key) > -1;
14 | }
15 |
16 | module.exports = listCacheHas;
17 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/lodash/_listCacheHas.js:
--------------------------------------------------------------------------------
1 | var assocIndexOf = require('./_assocIndexOf');
2 |
3 | /**
4 | * Checks if a list cache value for `key` exists.
5 | *
6 | * @private
7 | * @name has
8 | * @memberOf ListCache
9 | * @param {string} key The key of the entry to check.
10 | * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
11 | */
12 | function listCacheHas(key) {
13 | return assocIndexOf(this.__data__, key) > -1;
14 | }
15 |
16 | module.exports = listCacheHas;
17 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/lodash/_getMapData.js:
--------------------------------------------------------------------------------
1 | var isKeyable = require('./_isKeyable');
2 |
3 | /**
4 | * Gets the data for `map`.
5 | *
6 | * @private
7 | * @param {Object} map The map to query.
8 | * @param {string} key The reference key.
9 | * @returns {*} Returns the map data.
10 | */
11 | function getMapData(map, key) {
12 | var data = map.__data__;
13 | return isKeyable(key)
14 | ? data[typeof key == 'string' ? 'string' : 'hash']
15 | : data.map;
16 | }
17 |
18 | module.exports = getMapData;
19 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/lodash/_getMapData.js:
--------------------------------------------------------------------------------
1 | var isKeyable = require('./_isKeyable');
2 |
3 | /**
4 | * Gets the data for `map`.
5 | *
6 | * @private
7 | * @param {Object} map The map to query.
8 | * @param {string} key The reference key.
9 | * @returns {*} Returns the map data.
10 | */
11 | function getMapData(map, key) {
12 | var data = map.__data__;
13 | return isKeyable(key)
14 | ? data[typeof key == 'string' ? 'string' : 'hash']
15 | : data.map;
16 | }
17 |
18 | module.exports = getMapData;
19 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-normal-dep.js/miniprogram_npm/lodash/_listCacheHas.js:
--------------------------------------------------------------------------------
1 | var assocIndexOf = require('./_assocIndexOf');
2 |
3 | /**
4 | * Checks if a list cache value for `key` exists.
5 | *
6 | * @private
7 | * @name has
8 | * @memberOf ListCache
9 | * @param {string} key The key of the entry to check.
10 | * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
11 | */
12 | function listCacheHas(key) {
13 | return assocIndexOf(this.__data__, key) > -1;
14 | }
15 |
16 | module.exports = listCacheHas;
17 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-special-dep.json/miniprogram_npm/@miniprogram-component-plus/sticky/index.wxs:
--------------------------------------------------------------------------------
1 |
2 | /* eslint-disable */
3 | function wrapStyle(data) {
4 | if (data.fixed) {
5 | return 'top: ' + data.offsetTop + 'px;'
6 | }
7 | return ''
8 | }
9 |
10 | function containerStyle(data) {
11 | if (data.fixed) {
12 | return 'height: ' + data.height + 'px; z-index: ' + data.zIndex + ';'
13 | }
14 | return ''
15 | }
16 |
17 | module.exports = {
18 | wrapStyle: wrapStyle,
19 | containerStyle: containerStyle
20 | }
21 |
--------------------------------------------------------------------------------
/test/fixtures/integration-test/src/components/quickstart/quickstart.less:
--------------------------------------------------------------------------------
1 | // quickstart.less
2 | .pre {
3 | width: 520rpx;
4 | margin: 0 auto;
5 | padding: 40rpx 50rpx;
6 | border-radius: 10rpx;
7 | background-color: #eee;
8 | font-size: 14px;
9 | font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
10 | line-height: 1.5;
11 | text-align: left;
12 | display: flex;
13 | flex-direction: column;
14 | }
15 | .code {
16 | color: #222;
17 | }
18 | .comment {
19 | color: #999;
20 | }
21 |
--------------------------------------------------------------------------------
/test/expected/integration-test/customize-npmDirname/app.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Object.defineProperty(exports, "__esModule", { value: true });
3 | var index_1 = require("./utils/index");
4 | App({
5 | onLaunch: function (options) {
6 | console.log('onLaunch options', options);
7 | },
8 | onShow: function () { },
9 | onHide: function () { },
10 | onError: function () { },
11 | onPageNotFound: function () { },
12 | globalData: {},
13 | emitter: (0, index_1.mitt)(),
14 | });
15 |
16 | //# sourceMappingURL=app.js.map
17 |
--------------------------------------------------------------------------------
/test/expected/integration-test/customize-npmDirname/pages/index/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Page({
3 | data: {
4 | start: false,
5 | },
6 | onLoad: function (query) {
7 | console.log('onLoad query', query);
8 | },
9 | onShow: function () { },
10 | onReady: function () { },
11 | onHide: function () { },
12 | onUnload: function () { },
13 | quickstart: function () {
14 | this.setData({
15 | start: true,
16 | });
17 | }
18 | });
19 |
20 | //# sourceMappingURL=index.js.map
21 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/lodash/_mapCacheClear.js:
--------------------------------------------------------------------------------
1 | var Hash = require('./_Hash'),
2 | ListCache = require('./_ListCache'),
3 | Map = require('./_Map');
4 |
5 | /**
6 | * Removes all key-value entries from the map.
7 | *
8 | * @private
9 | * @name clear
10 | * @memberOf MapCache
11 | */
12 | function mapCacheClear() {
13 | this.size = 0;
14 | this.__data__ = {
15 | 'hash': new Hash,
16 | 'map': new (Map || ListCache),
17 | 'string': new Hash
18 | };
19 | }
20 |
21 | module.exports = mapCacheClear;
22 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-normal-dep.js/miniprogram_npm/lodash/_getMapData.js:
--------------------------------------------------------------------------------
1 | var isKeyable = require('./_isKeyable');
2 |
3 | /**
4 | * Gets the data for `map`.
5 | *
6 | * @private
7 | * @param {Object} map The map to query.
8 | * @param {string} key The reference key.
9 | * @returns {*} Returns the map data.
10 | */
11 | function getMapData(map, key) {
12 | var data = map.__data__;
13 | return isKeyable(key)
14 | ? data[typeof key == 'string' ? 'string' : 'hash']
15 | : data.map;
16 | }
17 |
18 | module.exports = getMapData;
19 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/lodash/_mapCacheClear.js:
--------------------------------------------------------------------------------
1 | var Hash = require('./_Hash'),
2 | ListCache = require('./_ListCache'),
3 | Map = require('./_Map');
4 |
5 | /**
6 | * Removes all key-value entries from the map.
7 | *
8 | * @private
9 | * @name clear
10 | * @memberOf MapCache
11 | */
12 | function mapCacheClear() {
13 | this.size = 0;
14 | this.__data__ = {
15 | 'hash': new Hash,
16 | 'map': new (Map || ListCache),
17 | 'string': new Hash
18 | };
19 | }
20 |
21 | module.exports = mapCacheClear;
22 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/lodash/_isKeyable.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Checks if `value` is suitable for use as unique object key.
3 | *
4 | * @private
5 | * @param {*} value The value to check.
6 | * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
7 | */
8 | function isKeyable(value) {
9 | var type = typeof value;
10 | return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
11 | ? (value !== '__proto__')
12 | : (value === null);
13 | }
14 |
15 | module.exports = isKeyable;
16 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/lodash/_isKeyable.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Checks if `value` is suitable for use as unique object key.
3 | *
4 | * @private
5 | * @param {*} value The value to check.
6 | * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
7 | */
8 | function isKeyable(value) {
9 | var type = typeof value;
10 | return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
11 | ? (value !== '__proto__')
12 | : (value === null);
13 | }
14 |
15 | module.exports = isKeyable;
16 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/tabbar/tabbar.js:
--------------------------------------------------------------------------------
1 | var globalThis=this,self=this;module.exports=require("../_commons/0.js")([{ids:[20],modules:{10:function(t,e,s){t.exports=s(109)},109:function(t,e){Component({options:{addGlobalClass:!0},properties:{extClass:{type:String,value:""},list:{type:Array,value:[]},current:{type:Number,value:0}},methods:{tabChange:function(t){var e=t.currentTarget.dataset.index;e!==this.data.current&&(this.setData({current:e}),this.triggerEvent("change",{index:e,item:this.data.list[e]}))}}})}},entries:[[10,0]]}]);
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/tabbar/tabbar.js:
--------------------------------------------------------------------------------
1 | var globalThis=this,self=this;module.exports=require("../_commons/0.js")([{ids:[20],modules:{10:function(t,e,s){t.exports=s(109)},109:function(t,e){Component({options:{addGlobalClass:!0},properties:{extClass:{type:String,value:""},list:{type:Array,value:[]},current:{type:Number,value:0}},methods:{tabChange:function(t){var e=t.currentTarget.dataset.index;e!==this.data.current&&(this.setData({current:e}),this.triggerEvent("change",{index:e,item:this.data.list[e]}))}}})}},entries:[[10,0]]}]);
--------------------------------------------------------------------------------
/test/expected/integration-test/default/components/quickstart/quickstart.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Component({
3 | options: {
4 | addGlobalClass: true,
5 | },
6 | properties: {},
7 | data: {},
8 | observers: {},
9 | lifetimes: {
10 | ready: function () { },
11 | detached: function () { },
12 | },
13 | pageLifetimes: {
14 | show: function () { },
15 | hide: function () { },
16 | resize: function () { }
17 | },
18 | methods: {}
19 | });
20 |
21 | //# sourceMappingURL=quickstart.js.map
22 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-normal-dep.js/miniprogram_npm/lodash/_isKeyable.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Checks if `value` is suitable for use as unique object key.
3 | *
4 | * @private
5 | * @param {*} value The value to check.
6 | * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
7 | */
8 | function isKeyable(value) {
9 | var type = typeof value;
10 | return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
11 | ? (value !== '__proto__')
12 | : (value === null);
13 | }
14 |
15 | module.exports = isKeyable;
16 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-normal-dep.js/miniprogram_npm/lodash/_mapCacheClear.js:
--------------------------------------------------------------------------------
1 | var Hash = require('./_Hash'),
2 | ListCache = require('./_ListCache'),
3 | Map = require('./_Map');
4 |
5 | /**
6 | * Removes all key-value entries from the map.
7 | *
8 | * @private
9 | * @name clear
10 | * @memberOf MapCache
11 | */
12 | function mapCacheClear() {
13 | this.size = 0;
14 | this.__data__ = {
15 | 'hash': new Hash,
16 | 'map': new (Map || ListCache),
17 | 'string': new Hash
18 | };
19 | }
20 |
21 | module.exports = mapCacheClear;
22 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-wxs-dep.json/miniprogram_npm/@vant/weapp/mixins/basic.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Object.defineProperty(exports, "__esModule", { value: true });
3 | exports.basic = void 0;
4 | exports.basic = Behavior({
5 | methods: {
6 | $emit: function (name, detail, options) {
7 | this.triggerEvent(name, detail, options);
8 | },
9 | set: function (data) {
10 | this.setData(data);
11 | return new Promise(function (resolve) { return wx.nextTick(resolve); });
12 | },
13 | },
14 | });
15 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/lodash/_listCacheGet.js:
--------------------------------------------------------------------------------
1 | var assocIndexOf = require('./_assocIndexOf');
2 |
3 | /**
4 | * Gets the list cache value for `key`.
5 | *
6 | * @private
7 | * @name get
8 | * @memberOf ListCache
9 | * @param {string} key The key of the value to get.
10 | * @returns {*} Returns the entry value.
11 | */
12 | function listCacheGet(key) {
13 | var data = this.__data__,
14 | index = assocIndexOf(data, key);
15 |
16 | return index < 0 ? undefined : data[index][1];
17 | }
18 |
19 | module.exports = listCacheGet;
20 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/lodash/_listCacheGet.js:
--------------------------------------------------------------------------------
1 | var assocIndexOf = require('./_assocIndexOf');
2 |
3 | /**
4 | * Gets the list cache value for `key`.
5 | *
6 | * @private
7 | * @name get
8 | * @memberOf ListCache
9 | * @param {string} key The key of the value to get.
10 | * @returns {*} Returns the entry value.
11 | */
12 | function listCacheGet(key) {
13 | var data = this.__data__,
14 | index = assocIndexOf(data, key);
15 |
16 | return index < 0 ? undefined : data[index][1];
17 | }
18 |
19 | module.exports = listCacheGet;
20 |
--------------------------------------------------------------------------------
/test/expected/integration-test/customize-npmDirname/components/quickstart/quickstart.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Component({
3 | options: {
4 | addGlobalClass: true,
5 | },
6 | properties: {},
7 | data: {},
8 | observers: {},
9 | lifetimes: {
10 | ready: function () { },
11 | detached: function () { },
12 | },
13 | pageLifetimes: {
14 | show: function () { },
15 | hide: function () { },
16 | resize: function () { }
17 | },
18 | methods: {}
19 | });
20 |
21 | //# sourceMappingURL=quickstart.js.map
22 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/mitt/dist/mitt.umd.js:
--------------------------------------------------------------------------------
1 | !function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e=e||self).mitt=n()}(this,function(){return function(e){return{all:e=e||new Map,on:function(n,t){var f=e.get(n);f?f.push(t):e.set(n,[t])},off:function(n,t){var f=e.get(n);f&&(t?f.splice(f.indexOf(t)>>>0,1):e.set(n,[]))},emit:function(n,t){var f=e.get(n);f&&f.slice().map(function(e){e(t)}),(f=e.get("*"))&&f.slice().map(function(e){e(n,t)})}}}});
2 | //# sourceMappingURL=mitt.umd.js.map
3 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/escape-string-regexp/index.js:
--------------------------------------------------------------------------------
1 | export default function escapeStringRegexp(string) {
2 | if (typeof string !== 'string') {
3 | throw new TypeError('Expected a string');
4 | }
5 |
6 | // Escape characters with special meaning either inside or outside character sets.
7 | // Use a simple backslash escape when it’s always valid, and a `\xnn` escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar.
8 | return string
9 | .replace(/[|\\{}()[\]^$+*?.]/g, '\\$&')
10 | .replace(/-/g, '\\x2d');
11 | }
12 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/lodash/_hashDelete.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Removes `key` and its value from the hash.
3 | *
4 | * @private
5 | * @name delete
6 | * @memberOf Hash
7 | * @param {Object} hash The hash to modify.
8 | * @param {string} key The key of the value to remove.
9 | * @returns {boolean} Returns `true` if the entry was removed, else `false`.
10 | */
11 | function hashDelete(key) {
12 | var result = this.has(key) && delete this.__data__[key];
13 | this.size -= result ? 1 : 0;
14 | return result;
15 | }
16 |
17 | module.exports = hashDelete;
18 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-normal-dep.js/miniprogram_npm/lodash/_listCacheGet.js:
--------------------------------------------------------------------------------
1 | var assocIndexOf = require('./_assocIndexOf');
2 |
3 | /**
4 | * Gets the list cache value for `key`.
5 | *
6 | * @private
7 | * @name get
8 | * @memberOf ListCache
9 | * @param {string} key The key of the value to get.
10 | * @returns {*} Returns the entry value.
11 | */
12 | function listCacheGet(key) {
13 | var data = this.__data__,
14 | index = assocIndexOf(data, key);
15 |
16 | return index < 0 ? undefined : data[index][1];
17 | }
18 |
19 | module.exports = listCacheGet;
20 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/escape-string-regexp/index.js:
--------------------------------------------------------------------------------
1 | export default function escapeStringRegexp(string) {
2 | if (typeof string !== 'string') {
3 | throw new TypeError('Expected a string');
4 | }
5 |
6 | // Escape characters with special meaning either inside or outside character sets.
7 | // Use a simple backslash escape when it’s always valid, and a `\xnn` escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar.
8 | return string
9 | .replace(/[|\\{}()[\]^$+*?.]/g, '\\$&')
10 | .replace(/-/g, '\\x2d');
11 | }
12 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/lodash/_hashDelete.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Removes `key` and its value from the hash.
3 | *
4 | * @private
5 | * @name delete
6 | * @memberOf Hash
7 | * @param {Object} hash The hash to modify.
8 | * @param {string} key The key of the value to remove.
9 | * @returns {boolean} Returns `true` if the entry was removed, else `false`.
10 | */
11 | function hashDelete(key) {
12 | var result = this.has(key) && delete this.__data__[key];
13 | this.size -= result ? 1 : 0;
14 | return result;
15 | }
16 |
17 | module.exports = hashDelete;
18 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-normal-dep.js/miniprogram_npm/lodash/_hashDelete.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Removes `key` and its value from the hash.
3 | *
4 | * @private
5 | * @name delete
6 | * @memberOf Hash
7 | * @param {Object} hash The hash to modify.
8 | * @param {string} key The key of the value to remove.
9 | * @returns {boolean} Returns `true` if the entry was removed, else `false`.
10 | */
11 | function hashDelete(key) {
12 | var result = this.has(key) && delete this.__data__[key];
13 | this.size -= result ? 1 : 0;
14 | return result;
15 | }
16 |
17 | module.exports = hashDelete;
18 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-wxs-dep.json/miniprogram_npm/@vant/weapp/loading/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Object.defineProperty(exports, "__esModule", { value: true });
3 | var component_1 = require("../common/component");
4 | (0, component_1.VantComponent)({
5 | props: {
6 | color: String,
7 | vertical: Boolean,
8 | type: {
9 | type: String,
10 | value: 'circular',
11 | },
12 | size: String,
13 | textSize: String,
14 | },
15 | data: {
16 | array12: Array.from({ length: 12 }),
17 | },
18 | });
19 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/lodash/_mapCacheDelete.js:
--------------------------------------------------------------------------------
1 | var getMapData = require('./_getMapData');
2 |
3 | /**
4 | * Removes `key` and its value from the map.
5 | *
6 | * @private
7 | * @name delete
8 | * @memberOf MapCache
9 | * @param {string} key The key of the value to remove.
10 | * @returns {boolean} Returns `true` if the entry was removed, else `false`.
11 | */
12 | function mapCacheDelete(key) {
13 | var result = getMapData(this, key)['delete'](key);
14 | this.size -= result ? 1 : 0;
15 | return result;
16 | }
17 |
18 | module.exports = mapCacheDelete;
19 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-deep-scope-dep.js/miniprogram_npm/escape-string-regexp/index.js:
--------------------------------------------------------------------------------
1 | export default function escapeStringRegexp(string) {
2 | if (typeof string !== 'string') {
3 | throw new TypeError('Expected a string');
4 | }
5 |
6 | // Escape characters with special meaning either inside or outside character sets.
7 | // Use a simple backslash escape when it’s always valid, and a `\xnn` escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar.
8 | return string
9 | .replace(/[|\\{}()[\]^$+*?.]/g, '\\$&')
10 | .replace(/-/g, '\\x2d');
11 | }
12 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/lodash/_mapCacheDelete.js:
--------------------------------------------------------------------------------
1 | var getMapData = require('./_getMapData');
2 |
3 | /**
4 | * Removes `key` and its value from the map.
5 | *
6 | * @private
7 | * @name delete
8 | * @memberOf MapCache
9 | * @param {string} key The key of the value to remove.
10 | * @returns {boolean} Returns `true` if the entry was removed, else `false`.
11 | */
12 | function mapCacheDelete(key) {
13 | var result = getMapData(this, key)['delete'](key);
14 | this.size -= result ? 1 : 0;
15 | return result;
16 | }
17 |
18 | module.exports = mapCacheDelete;
19 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-wxs-dep.json/miniprogram_npm/@vant/weapp/loading/index.wxs:
--------------------------------------------------------------------------------
1 | /* eslint-disable */
2 | var style = require('../wxs/style.wxs');
3 | var addUnit = require('../wxs/add-unit.wxs');
4 |
5 | function spinnerStyle(data) {
6 | return style({
7 | color: data.color,
8 | width: addUnit(data.size),
9 | height: addUnit(data.size),
10 | });
11 | }
12 |
13 | function textStyle(data) {
14 | return style({
15 | 'font-size': addUnit(data.textSize),
16 | });
17 | }
18 |
19 | module.exports = {
20 | spinnerStyle: spinnerStyle,
21 | textStyle: textStyle,
22 | };
23 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-normal-dep.js/miniprogram_npm/lodash/_mapCacheDelete.js:
--------------------------------------------------------------------------------
1 | var getMapData = require('./_getMapData');
2 |
3 | /**
4 | * Removes `key` and its value from the map.
5 | *
6 | * @private
7 | * @name delete
8 | * @memberOf MapCache
9 | * @param {string} key The key of the value to remove.
10 | * @returns {boolean} Returns `true` if the entry was removed, else `false`.
11 | */
12 | function mapCacheDelete(key) {
13 | var result = getMapData(this, key)['delete'](key);
14 | this.size -= result ? 1 : 0;
15 | return result;
16 | }
17 |
18 | module.exports = mapCacheDelete;
19 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/loading/loading.wxml:
--------------------------------------------------------------------------------
1 | {{tips}}
2 |
--------------------------------------------------------------------------------
/test/fixtures/integration-test/src/app.ts:
--------------------------------------------------------------------------------
1 | // app.ts
2 | import { mitt } from './utils/index';
3 |
4 | App({
5 | /* 生命周期 */
6 | // 小程序初始化完成时触发,全局只触发一次
7 | onLaunch(options) {
8 | console.log('onLaunch options', options);
9 | },
10 | // 小程序启动,或从后台进入前台显示时触发
11 | onShow() { },
12 | // 小程序从前台进入后台时触发
13 | onHide() { },
14 | // 小程序发生脚本错误或 API 调用报错时触发
15 | onError() { },
16 | // 小程序要打开的页面不存在时触发
17 | onPageNotFound() { },
18 |
19 | /* Global Data */
20 | globalData: { },
21 |
22 | emitter: mitt(),
23 |
24 | /* Global Methods */
25 |
26 | });
27 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/lodash/_getNative.js:
--------------------------------------------------------------------------------
1 | var baseIsNative = require('./_baseIsNative'),
2 | getValue = require('./_getValue');
3 |
4 | /**
5 | * Gets the native function at `key` of `object`.
6 | *
7 | * @private
8 | * @param {Object} object The object to query.
9 | * @param {string} key The key of the method to get.
10 | * @returns {*} Returns the function if it's native, else `undefined`.
11 | */
12 | function getNative(object, key) {
13 | var value = getValue(object, key);
14 | return baseIsNative(value) ? value : undefined;
15 | }
16 |
17 | module.exports = getNative;
18 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/icon/icon.wxml:
--------------------------------------------------------------------------------
1 |
2 | var double = function(a) {
3 | return 2*a
4 | };
5 | var ifSpecialIcon = function(v) {
6 | return v === 'arrow' || v === 'back'
7 | }
8 | module.exports = {
9 | double: double,
10 | ifSpecialIcon: ifSpecialIcon
11 | }
12 |
13 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/icon/icon.wxml:
--------------------------------------------------------------------------------
1 |
2 | var double = function(a) {
3 | return 2*a
4 | };
5 | var ifSpecialIcon = function(v) {
6 | return v === 'arrow' || v === 'back'
7 | }
8 | module.exports = {
9 | double: double,
10 | ifSpecialIcon: ifSpecialIcon
11 | }
12 |
13 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/loading/loading.wxml:
--------------------------------------------------------------------------------
1 | {{tips}}
2 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/lodash/_getNative.js:
--------------------------------------------------------------------------------
1 | var baseIsNative = require('./_baseIsNative'),
2 | getValue = require('./_getValue');
3 |
4 | /**
5 | * Gets the native function at `key` of `object`.
6 | *
7 | * @private
8 | * @param {Object} object The object to query.
9 | * @param {string} key The key of the method to get.
10 | * @returns {*} Returns the function if it's native, else `undefined`.
11 | */
12 | function getNative(object, key) {
13 | var value = getValue(object, key);
14 | return baseIsNative(value) ? value : undefined;
15 | }
16 |
17 | module.exports = getNative;
18 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/tabbar/tabbar.wxml:
--------------------------------------------------------------------------------
1 | {{item.text}}
2 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/tabbar/tabbar.wxml:
--------------------------------------------------------------------------------
1 | {{item.text}}
2 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-normal-dep.js/miniprogram_npm/lodash/_getNative.js:
--------------------------------------------------------------------------------
1 | var baseIsNative = require('./_baseIsNative'),
2 | getValue = require('./_getValue');
3 |
4 | /**
5 | * Gets the native function at `key` of `object`.
6 | *
7 | * @private
8 | * @param {Object} object The object to query.
9 | * @param {string} key The key of the method to get.
10 | * @returns {*} Returns the function if it's native, else `undefined`.
11 | */
12 | function getNative(object, key) {
13 | var value = getValue(object, key);
14 | return baseIsNative(value) ? value : undefined;
15 | }
16 |
17 | module.exports = getNative;
18 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/lodash/_assocIndexOf.js:
--------------------------------------------------------------------------------
1 | var eq = require('./eq');
2 |
3 | /**
4 | * Gets the index at which the `key` is found in `array` of key-value pairs.
5 | *
6 | * @private
7 | * @param {Array} array The array to inspect.
8 | * @param {*} key The key to search for.
9 | * @returns {number} Returns the index of the matched value, else `-1`.
10 | */
11 | function assocIndexOf(array, key) {
12 | var length = array.length;
13 | while (length--) {
14 | if (eq(array[length][0], key)) {
15 | return length;
16 | }
17 | }
18 | return -1;
19 | }
20 |
21 | module.exports = assocIndexOf;
22 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/lodash/_assocIndexOf.js:
--------------------------------------------------------------------------------
1 | var eq = require('./eq');
2 |
3 | /**
4 | * Gets the index at which the `key` is found in `array` of key-value pairs.
5 | *
6 | * @private
7 | * @param {Array} array The array to inspect.
8 | * @param {*} key The key to search for.
9 | * @returns {number} Returns the index of the matched value, else `-1`.
10 | */
11 | function assocIndexOf(array, key) {
12 | var length = array.length;
13 | while (length--) {
14 | if (eq(array[length][0], key)) {
15 | return length;
16 | }
17 | }
18 | return -1;
19 | }
20 |
21 | module.exports = assocIndexOf;
22 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/lodash/_mapCacheSet.js:
--------------------------------------------------------------------------------
1 | var getMapData = require('./_getMapData');
2 |
3 | /**
4 | * Sets the map `key` to `value`.
5 | *
6 | * @private
7 | * @name set
8 | * @memberOf MapCache
9 | * @param {string} key The key of the value to set.
10 | * @param {*} value The value to set.
11 | * @returns {Object} Returns the map cache instance.
12 | */
13 | function mapCacheSet(key, value) {
14 | var data = getMapData(this, key),
15 | size = data.size;
16 |
17 | data.set(key, value);
18 | this.size += data.size == size ? 0 : 1;
19 | return this;
20 | }
21 |
22 | module.exports = mapCacheSet;
23 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/lodash/_mapCacheSet.js:
--------------------------------------------------------------------------------
1 | var getMapData = require('./_getMapData');
2 |
3 | /**
4 | * Sets the map `key` to `value`.
5 | *
6 | * @private
7 | * @name set
8 | * @memberOf MapCache
9 | * @param {string} key The key of the value to set.
10 | * @param {*} value The value to set.
11 | * @returns {Object} Returns the map cache instance.
12 | */
13 | function mapCacheSet(key, value) {
14 | var data = getMapData(this, key),
15 | size = data.size;
16 |
17 | data.set(key, value);
18 | this.size += data.size == size ? 0 : 1;
19 | return this;
20 | }
21 |
22 | module.exports = mapCacheSet;
23 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-normal-dep.js/miniprogram_npm/lodash/_assocIndexOf.js:
--------------------------------------------------------------------------------
1 | var eq = require('./eq');
2 |
3 | /**
4 | * Gets the index at which the `key` is found in `array` of key-value pairs.
5 | *
6 | * @private
7 | * @param {Array} array The array to inspect.
8 | * @param {*} key The key to search for.
9 | * @returns {number} Returns the index of the matched value, else `-1`.
10 | */
11 | function assocIndexOf(array, key) {
12 | var length = array.length;
13 | while (length--) {
14 | if (eq(array[length][0], key)) {
15 | return length;
16 | }
17 | }
18 | return -1;
19 | }
20 |
21 | module.exports = assocIndexOf;
22 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/utils/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Object.defineProperty(exports, "__esModule", { value: true });
3 | exports.mitt = exports.promisify = exports.promisifyAll = void 0;
4 | var miniprogram_api_promise_1 = require("miniprogram-api-promise");
5 | Object.defineProperty(exports, "promisifyAll", { enumerable: true, get: function () { return miniprogram_api_promise_1.promisifyAll; } });
6 | Object.defineProperty(exports, "promisify", { enumerable: true, get: function () { return miniprogram_api_promise_1.promisify; } });
7 | var mitt_1 = require("mitt");
8 | exports.mitt = mitt_1.default;
9 |
10 | //# sourceMappingURL=index.js.map
11 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-normal-dep.js/miniprogram_npm/lodash/_mapCacheSet.js:
--------------------------------------------------------------------------------
1 | var getMapData = require('./_getMapData');
2 |
3 | /**
4 | * Sets the map `key` to `value`.
5 | *
6 | * @private
7 | * @name set
8 | * @memberOf MapCache
9 | * @param {string} key The key of the value to set.
10 | * @param {*} value The value to set.
11 | * @returns {Object} Returns the map cache instance.
12 | */
13 | function mapCacheSet(key, value) {
14 | var data = getMapData(this, key),
15 | size = data.size;
16 |
17 | data.set(key, value);
18 | this.size += data.size == size ? 0 : 1;
19 | return this;
20 | }
21 |
22 | module.exports = mapCacheSet;
23 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/lodash/isArray.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Checks if `value` is classified as an `Array` object.
3 | *
4 | * @static
5 | * @memberOf _
6 | * @since 0.1.0
7 | * @category Lang
8 | * @param {*} value The value to check.
9 | * @returns {boolean} Returns `true` if `value` is an array, else `false`.
10 | * @example
11 | *
12 | * _.isArray([1, 2, 3]);
13 | * // => true
14 | *
15 | * _.isArray(document.body.children);
16 | * // => false
17 | *
18 | * _.isArray('abc');
19 | * // => false
20 | *
21 | * _.isArray(_.noop);
22 | * // => false
23 | */
24 | var isArray = Array.isArray;
25 |
26 | module.exports = isArray;
27 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/lodash/isArray.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Checks if `value` is classified as an `Array` object.
3 | *
4 | * @static
5 | * @memberOf _
6 | * @since 0.1.0
7 | * @category Lang
8 | * @param {*} value The value to check.
9 | * @returns {boolean} Returns `true` if `value` is an array, else `false`.
10 | * @example
11 | *
12 | * _.isArray([1, 2, 3]);
13 | * // => true
14 | *
15 | * _.isArray(document.body.children);
16 | * // => false
17 | *
18 | * _.isArray('abc');
19 | * // => false
20 | *
21 | * _.isArray(_.noop);
22 | * // => false
23 | */
24 | var isArray = Array.isArray;
25 |
26 | module.exports = isArray;
27 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/lodash/_toKey.js:
--------------------------------------------------------------------------------
1 | var isSymbol = require('./isSymbol');
2 |
3 | /** Used as references for various `Number` constants. */
4 | var INFINITY = 1 / 0;
5 |
6 | /**
7 | * Converts `value` to a string key if it's not a string or symbol.
8 | *
9 | * @private
10 | * @param {*} value The value to inspect.
11 | * @returns {string|symbol} Returns the key.
12 | */
13 | function toKey(value) {
14 | if (typeof value == 'string' || isSymbol(value)) {
15 | return value;
16 | }
17 | var result = (value + '');
18 | return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
19 | }
20 |
21 | module.exports = toKey;
22 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-normal-dep.js/miniprogram_npm/lodash/isArray.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Checks if `value` is classified as an `Array` object.
3 | *
4 | * @static
5 | * @memberOf _
6 | * @since 0.1.0
7 | * @category Lang
8 | * @param {*} value The value to check.
9 | * @returns {boolean} Returns `true` if `value` is an array, else `false`.
10 | * @example
11 | *
12 | * _.isArray([1, 2, 3]);
13 | * // => true
14 | *
15 | * _.isArray(document.body.children);
16 | * // => false
17 | *
18 | * _.isArray('abc');
19 | * // => false
20 | *
21 | * _.isArray(_.noop);
22 | * // => false
23 | */
24 | var isArray = Array.isArray;
25 |
26 | module.exports = isArray;
27 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/lodash/_toKey.js:
--------------------------------------------------------------------------------
1 | var isSymbol = require('./isSymbol');
2 |
3 | /** Used as references for various `Number` constants. */
4 | var INFINITY = 1 / 0;
5 |
6 | /**
7 | * Converts `value` to a string key if it's not a string or symbol.
8 | *
9 | * @private
10 | * @param {*} value The value to inspect.
11 | * @returns {string|symbol} Returns the key.
12 | */
13 | function toKey(value) {
14 | if (typeof value == 'string' || isSymbol(value)) {
15 | return value;
16 | }
17 | var result = (value + '');
18 | return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
19 | }
20 |
21 | module.exports = toKey;
22 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-normal-dep.js/miniprogram_npm/lodash/_toKey.js:
--------------------------------------------------------------------------------
1 | var isSymbol = require('./isSymbol');
2 |
3 | /** Used as references for various `Number` constants. */
4 | var INFINITY = 1 / 0;
5 |
6 | /**
7 | * Converts `value` to a string key if it's not a string or symbol.
8 | *
9 | * @private
10 | * @param {*} value The value to inspect.
11 | * @returns {string|symbol} Returns the key.
12 | */
13 | function toKey(value) {
14 | if (typeof value == 'string' || isSymbol(value)) {
15 | return value;
16 | }
17 | var result = (value + '');
18 | return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
19 | }
20 |
21 | module.exports = toKey;
22 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-wxss/dist/example/actionsheet/actionsheet.js:
--------------------------------------------------------------------------------
1 | Page({
2 | mixins: [require('../../mixin/themeChanged')],
3 | data: {
4 | showIOSDialog: false,
5 | showAndroidDialog: false,
6 | },
7 | close: function() {
8 | this.setData({
9 | showIOSDialog: false,
10 | showAndroidDialog: false
11 | });
12 | },
13 | openIOS: function () {
14 | this.setData({
15 | showIOSDialog: true
16 | });
17 | },
18 | openAndroid: function () {
19 | this.setData({
20 | showAndroidDialog: true
21 | });
22 | }
23 | });
24 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/gallery/gallery.wxml:
--------------------------------------------------------------------------------
1 | {{current+1}}/{{currentImgs.length}}删除
2 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/gallery/gallery.wxml:
--------------------------------------------------------------------------------
1 | {{current+1}}/{{currentImgs.length}}删除
2 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/form-page/form-page.js:
--------------------------------------------------------------------------------
1 | var globalThis=this,self=this;module.exports=require("../_commons/0.js")([{ids:[8],modules:{2:function(e,s,t){e.exports=t(49)},49:function(e,s){Component({options:{addGlobalClass:!0,multipleSlots:!0},properties:{title:{type:String,value:""},subtitle:{type:String,value:""}},relations:{"../cells/cells":{type:"descendant",linked:function(e){this.data.firstItem||(this.data.firstItem=e),e.setOuterClass("weui-cells__group weui-cells__group_form weui-cells_form"),e!==this.data.firstItem&&e.setOuterClass("weui-cells__group_wxss weui-cells__group weui-cells__group_form weui-cells_form")}}},data:{firstItem:null}})}},entries:[[2,0]]}]);
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/form-page/form-page.js:
--------------------------------------------------------------------------------
1 | var globalThis=this,self=this;module.exports=require("../_commons/0.js")([{ids:[8],modules:{2:function(e,s,t){e.exports=t(49)},49:function(e,s){Component({options:{addGlobalClass:!0,multipleSlots:!0},properties:{title:{type:String,value:""},subtitle:{type:String,value:""}},relations:{"../cells/cells":{type:"descendant",linked:function(e){this.data.firstItem||(this.data.firstItem=e),e.setOuterClass("weui-cells__group weui-cells__group_form weui-cells_form"),e!==this.data.firstItem&&e.setOuterClass("weui-cells__group_wxss weui-cells__group weui-cells__group_form weui-cells_form")}}},data:{firstItem:null}})}},entries:[[2,0]]}]);
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/lodash/_arrayMap.js:
--------------------------------------------------------------------------------
1 | /**
2 | * A specialized version of `_.map` for arrays without support for iteratee
3 | * shorthands.
4 | *
5 | * @private
6 | * @param {Array} [array] The array to iterate over.
7 | * @param {Function} iteratee The function invoked per iteration.
8 | * @returns {Array} Returns the new mapped array.
9 | */
10 | function arrayMap(array, iteratee) {
11 | var index = -1,
12 | length = array == null ? 0 : array.length,
13 | result = Array(length);
14 |
15 | while (++index < length) {
16 | result[index] = iteratee(array[index], index, array);
17 | }
18 | return result;
19 | }
20 |
21 | module.exports = arrayMap;
22 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/lodash/_arrayMap.js:
--------------------------------------------------------------------------------
1 | /**
2 | * A specialized version of `_.map` for arrays without support for iteratee
3 | * shorthands.
4 | *
5 | * @private
6 | * @param {Array} [array] The array to iterate over.
7 | * @param {Function} iteratee The function invoked per iteration.
8 | * @returns {Array} Returns the new mapped array.
9 | */
10 | function arrayMap(array, iteratee) {
11 | var index = -1,
12 | length = array == null ? 0 : array.length,
13 | result = Array(length);
14 |
15 | while (++index < length) {
16 | result[index] = iteratee(array[index], index, array);
17 | }
18 | return result;
19 | }
20 |
21 | module.exports = arrayMap;
22 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/lodash/_isMasked.js:
--------------------------------------------------------------------------------
1 | var coreJsData = require('./_coreJsData');
2 |
3 | /** Used to detect methods masquerading as native. */
4 | var maskSrcKey = (function() {
5 | var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
6 | return uid ? ('Symbol(src)_1.' + uid) : '';
7 | }());
8 |
9 | /**
10 | * Checks if `func` has its source masked.
11 | *
12 | * @private
13 | * @param {Function} func The function to check.
14 | * @returns {boolean} Returns `true` if `func` is masked, else `false`.
15 | */
16 | function isMasked(func) {
17 | return !!maskSrcKey && (maskSrcKey in func);
18 | }
19 |
20 | module.exports = isMasked;
21 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/form-page/form-page.wxml:
--------------------------------------------------------------------------------
1 | {{title}}{{subtitle}}
2 |
--------------------------------------------------------------------------------
/test/expected/integration-test/customize-npmDirname/utils/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Object.defineProperty(exports, "__esModule", { value: true });
3 | exports.mitt = exports.promisify = exports.promisifyAll = void 0;
4 | var miniprogram_api_promise_1 = require("../dist/miniprogram-api-promise/src/index.js");
5 | Object.defineProperty(exports, "promisifyAll", { enumerable: true, get: function () { return miniprogram_api_promise_1.promisifyAll; } });
6 | Object.defineProperty(exports, "promisify", { enumerable: true, get: function () { return miniprogram_api_promise_1.promisify; } });
7 | var mitt_1 = require("../dist/mitt/dist/mitt.js");
8 | exports.mitt = mitt_1.default;
9 |
10 | //# sourceMappingURL=index.js.map
11 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/lodash/_isMasked.js:
--------------------------------------------------------------------------------
1 | var coreJsData = require('./_coreJsData');
2 |
3 | /** Used to detect methods masquerading as native. */
4 | var maskSrcKey = (function() {
5 | var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
6 | return uid ? ('Symbol(src)_1.' + uid) : '';
7 | }());
8 |
9 | /**
10 | * Checks if `func` has its source masked.
11 | *
12 | * @private
13 | * @param {Function} func The function to check.
14 | * @returns {boolean} Returns `true` if `func` is masked, else `false`.
15 | */
16 | function isMasked(func) {
17 | return !!maskSrcKey && (maskSrcKey in func);
18 | }
19 |
20 | module.exports = isMasked;
21 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/checkbox/checkbox.wxml:
--------------------------------------------------------------------------------
1 | {{label}}
2 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/checkbox/checkbox.wxml:
--------------------------------------------------------------------------------
1 | {{label}}
2 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/form-page/form-page.wxml:
--------------------------------------------------------------------------------
1 | {{title}}{{subtitle}}
2 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-normal-dep.js/miniprogram_npm/lodash/_arrayMap.js:
--------------------------------------------------------------------------------
1 | /**
2 | * A specialized version of `_.map` for arrays without support for iteratee
3 | * shorthands.
4 | *
5 | * @private
6 | * @param {Array} [array] The array to iterate over.
7 | * @param {Function} iteratee The function invoked per iteration.
8 | * @returns {Array} Returns the new mapped array.
9 | */
10 | function arrayMap(array, iteratee) {
11 | var index = -1,
12 | length = array == null ? 0 : array.length,
13 | result = Array(length);
14 |
15 | while (++index < length) {
16 | result[index] = iteratee(array[index], index, array);
17 | }
18 | return result;
19 | }
20 |
21 | module.exports = arrayMap;
22 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-wxs-dep.json/miniprogram_npm/@vant/weapp/loading/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/lodash/_castPath.js:
--------------------------------------------------------------------------------
1 | var isArray = require('./isArray'),
2 | isKey = require('./_isKey'),
3 | stringToPath = require('./_stringToPath'),
4 | toString = require('./toString');
5 |
6 | /**
7 | * Casts `value` to a path array if it's not one.
8 | *
9 | * @private
10 | * @param {*} value The value to inspect.
11 | * @param {Object} [object] The object to query keys on.
12 | * @returns {Array} Returns the cast property path array.
13 | */
14 | function castPath(value, object) {
15 | if (isArray(value)) {
16 | return value;
17 | }
18 | return isKey(value, object) ? [value] : stringToPath(toString(value));
19 | }
20 |
21 | module.exports = castPath;
22 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/lodash/_castPath.js:
--------------------------------------------------------------------------------
1 | var isArray = require('./isArray'),
2 | isKey = require('./_isKey'),
3 | stringToPath = require('./_stringToPath'),
4 | toString = require('./toString');
5 |
6 | /**
7 | * Casts `value` to a path array if it's not one.
8 | *
9 | * @private
10 | * @param {*} value The value to inspect.
11 | * @param {Object} [object] The object to query keys on.
12 | * @returns {Array} Returns the cast property path array.
13 | */
14 | function castPath(value, object) {
15 | if (isArray(value)) {
16 | return value;
17 | }
18 | return isKey(value, object) ? [value] : stringToPath(toString(value));
19 | }
20 |
21 | module.exports = castPath;
22 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-normal-dep.js/miniprogram_npm/lodash/_isMasked.js:
--------------------------------------------------------------------------------
1 | var coreJsData = require('./_coreJsData');
2 |
3 | /** Used to detect methods masquerading as native. */
4 | var maskSrcKey = (function() {
5 | var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
6 | return uid ? ('Symbol(src)_1.' + uid) : '';
7 | }());
8 |
9 | /**
10 | * Checks if `func` has its source masked.
11 | *
12 | * @private
13 | * @param {Function} func The function to check.
14 | * @returns {boolean} Returns `true` if `func` is masked, else `false`.
15 | */
16 | function isMasked(func) {
17 | return !!maskSrcKey && (maskSrcKey in func);
18 | }
19 |
20 | module.exports = isMasked;
21 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/lodash/_objectToString.js:
--------------------------------------------------------------------------------
1 | /** Used for built-in method references. */
2 | var objectProto = Object.prototype;
3 |
4 | /**
5 | * Used to resolve the
6 | * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
7 | * of values.
8 | */
9 | var nativeObjectToString = objectProto.toString;
10 |
11 | /**
12 | * Converts `value` to a string using `Object.prototype.toString`.
13 | *
14 | * @private
15 | * @param {*} value The value to convert.
16 | * @returns {string} Returns the converted string.
17 | */
18 | function objectToString(value) {
19 | return nativeObjectToString.call(value);
20 | }
21 |
22 | module.exports = objectToString;
23 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/lodash/_objectToString.js:
--------------------------------------------------------------------------------
1 | /** Used for built-in method references. */
2 | var objectProto = Object.prototype;
3 |
4 | /**
5 | * Used to resolve the
6 | * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
7 | * of values.
8 | */
9 | var nativeObjectToString = objectProto.toString;
10 |
11 | /**
12 | * Converts `value` to a string using `Object.prototype.toString`.
13 | *
14 | * @private
15 | * @param {*} value The value to convert.
16 | * @returns {string} Returns the converted string.
17 | */
18 | function objectToString(value) {
19 | return nativeObjectToString.call(value);
20 | }
21 |
22 | module.exports = objectToString;
23 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/lodash/_listCacheSet.js:
--------------------------------------------------------------------------------
1 | var assocIndexOf = require('./_assocIndexOf');
2 |
3 | /**
4 | * Sets the list cache `key` to `value`.
5 | *
6 | * @private
7 | * @name set
8 | * @memberOf ListCache
9 | * @param {string} key The key of the value to set.
10 | * @param {*} value The value to set.
11 | * @returns {Object} Returns the list cache instance.
12 | */
13 | function listCacheSet(key, value) {
14 | var data = this.__data__,
15 | index = assocIndexOf(data, key);
16 |
17 | if (index < 0) {
18 | ++this.size;
19 | data.push([key, value]);
20 | } else {
21 | data[index][1] = value;
22 | }
23 | return this;
24 | }
25 |
26 | module.exports = listCacheSet;
27 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/lodash/_toSource.js:
--------------------------------------------------------------------------------
1 | /** Used for built-in method references. */
2 | var funcProto = Function.prototype;
3 |
4 | /** Used to resolve the decompiled source of functions. */
5 | var funcToString = funcProto.toString;
6 |
7 | /**
8 | * Converts `func` to its source code.
9 | *
10 | * @private
11 | * @param {Function} func The function to convert.
12 | * @returns {string} Returns the source code.
13 | */
14 | function toSource(func) {
15 | if (func != null) {
16 | try {
17 | return funcToString.call(func);
18 | } catch (e) {}
19 | try {
20 | return (func + '');
21 | } catch (e) {}
22 | }
23 | return '';
24 | }
25 |
26 | module.exports = toSource;
27 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-normal-dep.js/miniprogram_npm/lodash/_castPath.js:
--------------------------------------------------------------------------------
1 | var isArray = require('./isArray'),
2 | isKey = require('./_isKey'),
3 | stringToPath = require('./_stringToPath'),
4 | toString = require('./toString');
5 |
6 | /**
7 | * Casts `value` to a path array if it's not one.
8 | *
9 | * @private
10 | * @param {*} value The value to inspect.
11 | * @param {Object} [object] The object to query keys on.
12 | * @returns {Array} Returns the cast property path array.
13 | */
14 | function castPath(value, object) {
15 | if (isArray(value)) {
16 | return value;
17 | }
18 | return isKey(value, object) ? [value] : stringToPath(toString(value));
19 | }
20 |
21 | module.exports = castPath;
22 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/lodash/_listCacheSet.js:
--------------------------------------------------------------------------------
1 | var assocIndexOf = require('./_assocIndexOf');
2 |
3 | /**
4 | * Sets the list cache `key` to `value`.
5 | *
6 | * @private
7 | * @name set
8 | * @memberOf ListCache
9 | * @param {string} key The key of the value to set.
10 | * @param {*} value The value to set.
11 | * @returns {Object} Returns the list cache instance.
12 | */
13 | function listCacheSet(key, value) {
14 | var data = this.__data__,
15 | index = assocIndexOf(data, key);
16 |
17 | if (index < 0) {
18 | ++this.size;
19 | data.push([key, value]);
20 | } else {
21 | data[index][1] = value;
22 | }
23 | return this;
24 | }
25 |
26 | module.exports = listCacheSet;
27 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/lodash/_toSource.js:
--------------------------------------------------------------------------------
1 | /** Used for built-in method references. */
2 | var funcProto = Function.prototype;
3 |
4 | /** Used to resolve the decompiled source of functions. */
5 | var funcToString = funcProto.toString;
6 |
7 | /**
8 | * Converts `func` to its source code.
9 | *
10 | * @private
11 | * @param {Function} func The function to convert.
12 | * @returns {string} Returns the source code.
13 | */
14 | function toSource(func) {
15 | if (func != null) {
16 | try {
17 | return funcToString.call(func);
18 | } catch (e) {}
19 | try {
20 | return (func + '');
21 | } catch (e) {}
22 | }
23 | return '';
24 | }
25 |
26 | module.exports = toSource;
27 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-normal-dep.js/miniprogram_npm/lodash/_objectToString.js:
--------------------------------------------------------------------------------
1 | /** Used for built-in method references. */
2 | var objectProto = Object.prototype;
3 |
4 | /**
5 | * Used to resolve the
6 | * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
7 | * of values.
8 | */
9 | var nativeObjectToString = objectProto.toString;
10 |
11 | /**
12 | * Converts `value` to a string using `Object.prototype.toString`.
13 | *
14 | * @private
15 | * @param {*} value The value to convert.
16 | * @returns {string} Returns the converted string.
17 | */
18 | function objectToString(value) {
19 | return nativeObjectToString.call(value);
20 | }
21 |
22 | module.exports = objectToString;
23 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-normal-dep.js/miniprogram_npm/lodash/_listCacheSet.js:
--------------------------------------------------------------------------------
1 | var assocIndexOf = require('./_assocIndexOf');
2 |
3 | /**
4 | * Sets the list cache `key` to `value`.
5 | *
6 | * @private
7 | * @name set
8 | * @memberOf ListCache
9 | * @param {string} key The key of the value to set.
10 | * @param {*} value The value to set.
11 | * @returns {Object} Returns the list cache instance.
12 | */
13 | function listCacheSet(key, value) {
14 | var data = this.__data__,
15 | index = assocIndexOf(data, key);
16 |
17 | if (index < 0) {
18 | ++this.size;
19 | data.push([key, value]);
20 | } else {
21 | data[index][1] = value;
22 | }
23 | return this;
24 | }
25 |
26 | module.exports = listCacheSet;
27 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-normal-dep.js/miniprogram_npm/lodash/_toSource.js:
--------------------------------------------------------------------------------
1 | /** Used for built-in method references. */
2 | var funcProto = Function.prototype;
3 |
4 | /** Used to resolve the decompiled source of functions. */
5 | var funcToString = funcProto.toString;
6 |
7 | /**
8 | * Converts `func` to its source code.
9 | *
10 | * @private
11 | * @param {Function} func The function to convert.
12 | * @returns {string} Returns the source code.
13 | */
14 | function toSource(func) {
15 | if (func != null) {
16 | try {
17 | return funcToString.call(func);
18 | } catch (e) {}
19 | try {
20 | return (func + '');
21 | } catch (e) {}
22 | }
23 | return '';
24 | }
25 |
26 | module.exports = toSource;
27 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/lodash/_hashSet.js:
--------------------------------------------------------------------------------
1 | var nativeCreate = require('./_nativeCreate');
2 |
3 | /** Used to stand-in for `undefined` hash values. */
4 | var HASH_UNDEFINED = '__lodash_hash_undefined__';
5 |
6 | /**
7 | * Sets the hash `key` to `value`.
8 | *
9 | * @private
10 | * @name set
11 | * @memberOf Hash
12 | * @param {string} key The key of the value to set.
13 | * @param {*} value The value to set.
14 | * @returns {Object} Returns the hash instance.
15 | */
16 | function hashSet(key, value) {
17 | var data = this.__data__;
18 | this.size += this.has(key) ? 0 : 1;
19 | data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
20 | return this;
21 | }
22 |
23 | module.exports = hashSet;
24 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/lodash/_hashSet.js:
--------------------------------------------------------------------------------
1 | var nativeCreate = require('./_nativeCreate');
2 |
3 | /** Used to stand-in for `undefined` hash values. */
4 | var HASH_UNDEFINED = '__lodash_hash_undefined__';
5 |
6 | /**
7 | * Sets the hash `key` to `value`.
8 | *
9 | * @private
10 | * @name set
11 | * @memberOf Hash
12 | * @param {string} key The key of the value to set.
13 | * @param {*} value The value to set.
14 | * @returns {Object} Returns the hash instance.
15 | */
16 | function hashSet(key, value) {
17 | var data = this.__data__;
18 | this.size += this.has(key) ? 0 : 1;
19 | data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
20 | return this;
21 | }
22 |
23 | module.exports = hashSet;
24 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/components/quickstart/quickstart.wxss.map:
--------------------------------------------------------------------------------
1 | {"version":3,"sources":["components/quickstart/quickstart.less"],"names":[],"mappings":"AACA;EACI,aAAA;EACA,cAAA;EACA,oBAAA;EACA,oBAAA;EACA,sBAAA;EACA,eAAA;EACA,wEAAA;EACA,gBAAA;EACA,gBAAA;EACA,aAAA;EACA,sBAAA;;AAEJ;EACI,WAAA;;AAEJ;EACI,WAAA","sourcesContent":["// quickstart.less\n.pre {\n width: 520rpx;\n margin: 0 auto;\n padding: 40rpx 50rpx;\n border-radius: 10rpx;\n background-color: #eee;\n font-size: 14px;\n font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;\n line-height: 1.5;\n text-align: left;\n display: flex;\n flex-direction: column;\n}\n.code {\n color: #222;\n}\n.comment {\n color: #999;\n}\n"],"file":"quickstart.wxss"}
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/weui-miniprogram/msg/msg.wxml:
--------------------------------------------------------------------------------
1 | {{title}}{{desc}}
2 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/lodash/toString.js:
--------------------------------------------------------------------------------
1 | var baseToString = require('./_baseToString');
2 |
3 | /**
4 | * Converts `value` to a string. An empty string is returned for `null`
5 | * and `undefined` values. The sign of `-0` is preserved.
6 | *
7 | * @static
8 | * @memberOf _
9 | * @since 4.0.0
10 | * @category Lang
11 | * @param {*} value The value to convert.
12 | * @returns {string} Returns the converted string.
13 | * @example
14 | *
15 | * _.toString(null);
16 | * // => ''
17 | *
18 | * _.toString(-0);
19 | * // => '-0'
20 | *
21 | * _.toString([1, 2, 3]);
22 | * // => '1,2,3'
23 | */
24 | function toString(value) {
25 | return value == null ? '' : baseToString(value);
26 | }
27 |
28 | module.exports = toString;
29 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/dialog/dialog.wxml:
--------------------------------------------------------------------------------
1 | {{title}}{{item.text}}
2 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/msg/msg.wxml:
--------------------------------------------------------------------------------
1 | {{title}}{{desc}}
2 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/dialog/dialog.wxml:
--------------------------------------------------------------------------------
1 | {{title}}{{item.text}}
2 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/msg/msg.wxml:
--------------------------------------------------------------------------------
1 | {{title}}{{desc}}
2 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/lodash/toString.js:
--------------------------------------------------------------------------------
1 | var baseToString = require('./_baseToString');
2 |
3 | /**
4 | * Converts `value` to a string. An empty string is returned for `null`
5 | * and `undefined` values. The sign of `-0` is preserved.
6 | *
7 | * @static
8 | * @memberOf _
9 | * @since 4.0.0
10 | * @category Lang
11 | * @param {*} value The value to convert.
12 | * @returns {string} Returns the converted string.
13 | * @example
14 | *
15 | * _.toString(null);
16 | * // => ''
17 | *
18 | * _.toString(-0);
19 | * // => '-0'
20 | *
21 | * _.toString([1, 2, 3]);
22 | * // => '1,2,3'
23 | */
24 | function toString(value) {
25 | return value == null ? '' : baseToString(value);
26 | }
27 |
28 | module.exports = toString;
29 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-normal-dep.js/miniprogram_npm/lodash/_hashSet.js:
--------------------------------------------------------------------------------
1 | var nativeCreate = require('./_nativeCreate');
2 |
3 | /** Used to stand-in for `undefined` hash values. */
4 | var HASH_UNDEFINED = '__lodash_hash_undefined__';
5 |
6 | /**
7 | * Sets the hash `key` to `value`.
8 | *
9 | * @private
10 | * @name set
11 | * @memberOf Hash
12 | * @param {string} key The key of the value to set.
13 | * @param {*} value The value to set.
14 | * @returns {Object} Returns the hash instance.
15 | */
16 | function hashSet(key, value) {
17 | var data = this.__data__;
18 | this.size += this.has(key) ? 0 : 1;
19 | data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
20 | return this;
21 | }
22 |
23 | module.exports = hashSet;
24 |
--------------------------------------------------------------------------------
/test/expected/integration-test/customize-npmDirname/components/quickstart/quickstart.wxss.map:
--------------------------------------------------------------------------------
1 | {"version":3,"sources":["components/quickstart/quickstart.less"],"names":[],"mappings":"AACA;EACI,aAAA;EACA,cAAA;EACA,oBAAA;EACA,oBAAA;EACA,sBAAA;EACA,eAAA;EACA,wEAAA;EACA,gBAAA;EACA,gBAAA;EACA,aAAA;EACA,sBAAA;;AAEJ;EACI,WAAA;;AAEJ;EACI,WAAA","sourcesContent":["// quickstart.less\n.pre {\n width: 520rpx;\n margin: 0 auto;\n padding: 40rpx 50rpx;\n border-radius: 10rpx;\n background-color: #eee;\n font-size: 14px;\n font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;\n line-height: 1.5;\n text-align: left;\n display: flex;\n flex-direction: column;\n}\n.code {\n color: #222;\n}\n.comment {\n color: #999;\n}\n"],"file":"quickstart.wxss"}
--------------------------------------------------------------------------------
/test/expected/integration-test/customize-npmDirname/dist/weui-miniprogram/msg/msg.wxml:
--------------------------------------------------------------------------------
1 | {{title}}{{desc}}
2 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-normal-dep.js/miniprogram_npm/lodash/toString.js:
--------------------------------------------------------------------------------
1 | var baseToString = require('./_baseToString');
2 |
3 | /**
4 | * Converts `value` to a string. An empty string is returned for `null`
5 | * and `undefined` values. The sign of `-0` is preserved.
6 | *
7 | * @static
8 | * @memberOf _
9 | * @since 4.0.0
10 | * @category Lang
11 | * @param {*} value The value to convert.
12 | * @returns {string} Returns the converted string.
13 | * @example
14 | *
15 | * _.toString(null);
16 | * // => ''
17 | *
18 | * _.toString(-0);
19 | * // => '-0'
20 | *
21 | * _.toString([1, 2, 3]);
22 | * // => '1,2,3'
23 | */
24 | function toString(value) {
25 | return value == null ? '' : baseToString(value);
26 | }
27 |
28 | module.exports = toString;
29 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-special-dep.json/miniprogram_npm/weui-miniprogram/msg/msg.wxml:
--------------------------------------------------------------------------------
1 | {{title}}{{desc}}
2 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/lodash/_baseGet.js:
--------------------------------------------------------------------------------
1 | var castPath = require('./_castPath'),
2 | toKey = require('./_toKey');
3 |
4 | /**
5 | * The base implementation of `_.get` without support for default values.
6 | *
7 | * @private
8 | * @param {Object} object The object to query.
9 | * @param {Array|string} path The path of the property to get.
10 | * @returns {*} Returns the resolved value.
11 | */
12 | function baseGet(object, path) {
13 | path = castPath(path, object);
14 |
15 | var index = 0,
16 | length = path.length;
17 |
18 | while (object != null && index < length) {
19 | object = object[toKey(path[index++])];
20 | }
21 | return (index && index == length) ? object : undefined;
22 | }
23 |
24 | module.exports = baseGet;
25 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/lodash/_baseGet.js:
--------------------------------------------------------------------------------
1 | var castPath = require('./_castPath'),
2 | toKey = require('./_toKey');
3 |
4 | /**
5 | * The base implementation of `_.get` without support for default values.
6 | *
7 | * @private
8 | * @param {Object} object The object to query.
9 | * @param {Array|string} path The path of the property to get.
10 | * @returns {*} Returns the resolved value.
11 | */
12 | function baseGet(object, path) {
13 | path = castPath(path, object);
14 |
15 | var index = 0,
16 | length = path.length;
17 |
18 | while (object != null && index < length) {
19 | object = object[toKey(path[index++])];
20 | }
21 | return (index && index == length) ? object : undefined;
22 | }
23 |
24 | module.exports = baseGet;
25 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/lodash/_hashHas.js:
--------------------------------------------------------------------------------
1 | var nativeCreate = require('./_nativeCreate');
2 |
3 | /** Used for built-in method references. */
4 | var objectProto = Object.prototype;
5 |
6 | /** Used to check objects for own properties. */
7 | var hasOwnProperty = objectProto.hasOwnProperty;
8 |
9 | /**
10 | * Checks if a hash value for `key` exists.
11 | *
12 | * @private
13 | * @name has
14 | * @memberOf Hash
15 | * @param {string} key The key of the entry to check.
16 | * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
17 | */
18 | function hashHas(key) {
19 | var data = this.__data__;
20 | return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
21 | }
22 |
23 | module.exports = hashHas;
24 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/lodash/_hashHas.js:
--------------------------------------------------------------------------------
1 | var nativeCreate = require('./_nativeCreate');
2 |
3 | /** Used for built-in method references. */
4 | var objectProto = Object.prototype;
5 |
6 | /** Used to check objects for own properties. */
7 | var hasOwnProperty = objectProto.hasOwnProperty;
8 |
9 | /**
10 | * Checks if a hash value for `key` exists.
11 | *
12 | * @private
13 | * @name has
14 | * @memberOf Hash
15 | * @param {string} key The key of the entry to check.
16 | * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
17 | */
18 | function hashHas(key) {
19 | var data = this.__data__;
20 | return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
21 | }
22 |
23 | module.exports = hashHas;
24 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-normal-dep.js/miniprogram_npm/lodash/_baseGet.js:
--------------------------------------------------------------------------------
1 | var castPath = require('./_castPath'),
2 | toKey = require('./_toKey');
3 |
4 | /**
5 | * The base implementation of `_.get` without support for default values.
6 | *
7 | * @private
8 | * @param {Object} object The object to query.
9 | * @param {Array|string} path The path of the property to get.
10 | * @returns {*} Returns the resolved value.
11 | */
12 | function baseGet(object, path) {
13 | path = castPath(path, object);
14 |
15 | var index = 0,
16 | length = path.length;
17 |
18 | while (object != null && index < length) {
19 | object = object[toKey(path[index++])];
20 | }
21 | return (index && index == length) ? object : undefined;
22 | }
23 |
24 | module.exports = baseGet;
25 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-normal-dep.js/miniprogram_npm/lodash/_hashHas.js:
--------------------------------------------------------------------------------
1 | var nativeCreate = require('./_nativeCreate');
2 |
3 | /** Used for built-in method references. */
4 | var objectProto = Object.prototype;
5 |
6 | /** Used to check objects for own properties. */
7 | var hasOwnProperty = objectProto.hasOwnProperty;
8 |
9 | /**
10 | * Checks if a hash value for `key` exists.
11 | *
12 | * @private
13 | * @name has
14 | * @memberOf Hash
15 | * @param {string} key The key of the entry to check.
16 | * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
17 | */
18 | function hashHas(key) {
19 | var data = this.__data__;
20 | return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
21 | }
22 |
23 | module.exports = hashHas;
24 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/lodash/_baseAssignValue.js:
--------------------------------------------------------------------------------
1 | var defineProperty = require('./_defineProperty');
2 |
3 | /**
4 | * The base implementation of `assignValue` and `assignMergeValue` without
5 | * value checks.
6 | *
7 | * @private
8 | * @param {Object} object The object to modify.
9 | * @param {string} key The key of the property to assign.
10 | * @param {*} value The value to assign.
11 | */
12 | function baseAssignValue(object, key, value) {
13 | if (key == '__proto__' && defineProperty) {
14 | defineProperty(object, key, {
15 | 'configurable': true,
16 | 'enumerable': true,
17 | 'value': value,
18 | 'writable': true
19 | });
20 | } else {
21 | object[key] = value;
22 | }
23 | }
24 |
25 | module.exports = baseAssignValue;
26 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/lodash/_baseAssignValue.js:
--------------------------------------------------------------------------------
1 | var defineProperty = require('./_defineProperty');
2 |
3 | /**
4 | * The base implementation of `assignValue` and `assignMergeValue` without
5 | * value checks.
6 | *
7 | * @private
8 | * @param {Object} object The object to modify.
9 | * @param {string} key The key of the property to assign.
10 | * @param {*} value The value to assign.
11 | */
12 | function baseAssignValue(object, key, value) {
13 | if (key == '__proto__' && defineProperty) {
14 | defineProperty(object, key, {
15 | 'configurable': true,
16 | 'enumerable': true,
17 | 'value': value,
18 | 'writable': true
19 | });
20 | } else {
21 | object[key] = value;
22 | }
23 | }
24 |
25 | module.exports = baseAssignValue;
26 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/lodash/isObjectLike.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Checks if `value` is object-like. A value is object-like if it's not `null`
3 | * and has a `typeof` result of "object".
4 | *
5 | * @static
6 | * @memberOf _
7 | * @since 4.0.0
8 | * @category Lang
9 | * @param {*} value The value to check.
10 | * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
11 | * @example
12 | *
13 | * _.isObjectLike({});
14 | * // => true
15 | *
16 | * _.isObjectLike([1, 2, 3]);
17 | * // => true
18 | *
19 | * _.isObjectLike(_.noop);
20 | * // => false
21 | *
22 | * _.isObjectLike(null);
23 | * // => false
24 | */
25 | function isObjectLike(value) {
26 | return value != null && typeof value == 'object';
27 | }
28 |
29 | module.exports = isObjectLike;
30 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/lodash/isObjectLike.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Checks if `value` is object-like. A value is object-like if it's not `null`
3 | * and has a `typeof` result of "object".
4 | *
5 | * @static
6 | * @memberOf _
7 | * @since 4.0.0
8 | * @category Lang
9 | * @param {*} value The value to check.
10 | * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
11 | * @example
12 | *
13 | * _.isObjectLike({});
14 | * // => true
15 | *
16 | * _.isObjectLike([1, 2, 3]);
17 | * // => true
18 | *
19 | * _.isObjectLike(_.noop);
20 | * // => false
21 | *
22 | * _.isObjectLike(null);
23 | * // => false
24 | */
25 | function isObjectLike(value) {
26 | return value != null && typeof value == 'object';
27 | }
28 |
29 | module.exports = isObjectLike;
30 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/grids/grids.wxml:
--------------------------------------------------------------------------------
1 | {{item.text}}
2 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/grids/grids.wxml:
--------------------------------------------------------------------------------
1 | {{item.text}}
2 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/lodash/_memoizeCapped.js:
--------------------------------------------------------------------------------
1 | var memoize = require('./memoize');
2 |
3 | /** Used as the maximum memoize cache size. */
4 | var MAX_MEMOIZE_SIZE = 500;
5 |
6 | /**
7 | * A specialized version of `_.memoize` which clears the memoized function's
8 | * cache when it exceeds `MAX_MEMOIZE_SIZE`.
9 | *
10 | * @private
11 | * @param {Function} func The function to have its output memoized.
12 | * @returns {Function} Returns the new memoized function.
13 | */
14 | function memoizeCapped(func) {
15 | var result = memoize(func, function(key) {
16 | if (cache.size === MAX_MEMOIZE_SIZE) {
17 | cache.clear();
18 | }
19 | return key;
20 | });
21 |
22 | var cache = result.cache;
23 | return result;
24 | }
25 |
26 | module.exports = memoizeCapped;
27 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-normal-dep.js/miniprogram_npm/lodash/_baseAssignValue.js:
--------------------------------------------------------------------------------
1 | var defineProperty = require('./_defineProperty');
2 |
3 | /**
4 | * The base implementation of `assignValue` and `assignMergeValue` without
5 | * value checks.
6 | *
7 | * @private
8 | * @param {Object} object The object to modify.
9 | * @param {string} key The key of the property to assign.
10 | * @param {*} value The value to assign.
11 | */
12 | function baseAssignValue(object, key, value) {
13 | if (key == '__proto__' && defineProperty) {
14 | defineProperty(object, key, {
15 | 'configurable': true,
16 | 'enumerable': true,
17 | 'value': value,
18 | 'writable': true
19 | });
20 | } else {
21 | object[key] = value;
22 | }
23 | }
24 |
25 | module.exports = baseAssignValue;
26 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/lodash/_memoizeCapped.js:
--------------------------------------------------------------------------------
1 | var memoize = require('./memoize');
2 |
3 | /** Used as the maximum memoize cache size. */
4 | var MAX_MEMOIZE_SIZE = 500;
5 |
6 | /**
7 | * A specialized version of `_.memoize` which clears the memoized function's
8 | * cache when it exceeds `MAX_MEMOIZE_SIZE`.
9 | *
10 | * @private
11 | * @param {Function} func The function to have its output memoized.
12 | * @returns {Function} Returns the new memoized function.
13 | */
14 | function memoizeCapped(func) {
15 | var result = memoize(func, function(key) {
16 | if (cache.size === MAX_MEMOIZE_SIZE) {
17 | cache.clear();
18 | }
19 | return key;
20 | });
21 |
22 | var cache = result.cache;
23 | return result;
24 | }
25 |
26 | module.exports = memoizeCapped;
27 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/grids/grids.js:
--------------------------------------------------------------------------------
1 | var globalThis=this,self=this;module.exports=require("../_commons/0.js")([{ids:[11],modules:{173:function(e,t){var n={target:"self",url:"",openType:"navigate",delta:1,appId:"",path:"",extraData:"",version:"release",hoverClass:"navigator-hover",hoverStopPropagation:!1,hoverStartTime:50,hoverStayTime:600,bindsuccess:function(){},bindfail:function(){},bindcomplete:function(){}};Component({options:{addGlobalClass:!0,pureDataPattern:/^_/},properties:{extClass:{type:String,value:""},grids:{type:Array,value:[],observer:"_onGridsChange"}},data:{innerGrids:[]},ready:function(){},methods:{_onGridsChange:function(e){e&&this.setData({innerGrids:e.map((function(e){return Object.assign({},n,e)}))})}}})},18:function(e,t,n){e.exports=n(173)}},entries:[[18,0]]}]);
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/grids/grids.js:
--------------------------------------------------------------------------------
1 | var globalThis=this,self=this;module.exports=require("../_commons/0.js")([{ids:[11],modules:{173:function(e,t){var n={target:"self",url:"",openType:"navigate",delta:1,appId:"",path:"",extraData:"",version:"release",hoverClass:"navigator-hover",hoverStopPropagation:!1,hoverStartTime:50,hoverStayTime:600,bindsuccess:function(){},bindfail:function(){},bindcomplete:function(){}};Component({options:{addGlobalClass:!0,pureDataPattern:/^_/},properties:{extClass:{type:String,value:""},grids:{type:Array,value:[],observer:"_onGridsChange"}},data:{innerGrids:[]},ready:function(){},methods:{_onGridsChange:function(e){e&&this.setData({innerGrids:e.map((function(e){return Object.assign({},n,e)}))})}}})},18:function(e,t,n){e.exports=n(173)}},entries:[[18,0]]}]);
--------------------------------------------------------------------------------
/test/expected/unit-test/import-normal-dep.js/miniprogram_npm/lodash/isObjectLike.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Checks if `value` is object-like. A value is object-like if it's not `null`
3 | * and has a `typeof` result of "object".
4 | *
5 | * @static
6 | * @memberOf _
7 | * @since 4.0.0
8 | * @category Lang
9 | * @param {*} value The value to check.
10 | * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
11 | * @example
12 | *
13 | * _.isObjectLike({});
14 | * // => true
15 | *
16 | * _.isObjectLike([1, 2, 3]);
17 | * // => true
18 | *
19 | * _.isObjectLike(_.noop);
20 | * // => false
21 | *
22 | * _.isObjectLike(null);
23 | * // => false
24 | */
25 | function isObjectLike(value) {
26 | return value != null && typeof value == 'object';
27 | }
28 |
29 | module.exports = isObjectLike;
30 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-normal-dep.js/miniprogram_npm/lodash/_memoizeCapped.js:
--------------------------------------------------------------------------------
1 | var memoize = require('./memoize');
2 |
3 | /** Used as the maximum memoize cache size. */
4 | var MAX_MEMOIZE_SIZE = 500;
5 |
6 | /**
7 | * A specialized version of `_.memoize` which clears the memoized function's
8 | * cache when it exceeds `MAX_MEMOIZE_SIZE`.
9 | *
10 | * @private
11 | * @param {Function} func The function to have its output memoized.
12 | * @returns {Function} Returns the new memoized function.
13 | */
14 | function memoizeCapped(func) {
15 | var result = memoize(func, function(key) {
16 | if (cache.size === MAX_MEMOIZE_SIZE) {
17 | cache.clear();
18 | }
19 | return key;
20 | });
21 |
22 | var cache = result.cache;
23 | return result;
24 | }
25 |
26 | module.exports = memoizeCapped;
27 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-wxss/dist/example/badge/badge.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * WeUI v2.5.0 (https://github.com/weui/weui-wxss)
3 | * Copyright 2021 Tencent, Inc.
4 | * Licensed under the MIT license
5 | */
6 | image{height:50px}.weui-cells .demo_badge_tips{font-size:1rem;vertical-align:middle}.weui-cells .demo_badge_tips+.weui-badge{margin-left:5px;margin-right:5px}.demo_badge_cells .weui-cell__hd{position:relative;margin-right:10px}.demo_badge_cells .weui-cell__hd image{width:50px;display:block}.demo_badge_cells .weui-cell__hd .weui-badge{position:absolute;top:-.4em;right:-.4em}.demo_badge_cells .weui-cell__bd .demo_badge_title{vertical-align:middle}.demo_badge_cells .weui-cell__bd .demo_badge_title+.weui-badge{margin-left:5px}.demo_badge_cells .weui-cell__bd .demo_badge_desc{font-size:0.7647058823529411rem;color:#888}
--------------------------------------------------------------------------------
/test/fixtures/integration-test/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "scripts": {
4 | "start": "npm run dev",
5 | "dev": "gulp",
6 | "build": "gulp build"
7 | },
8 | "dependencies": {
9 | "miniprogram-api-promise": "^1.0.4",
10 | "mitt": "^1.2.0",
11 | "weui-miniprogram": "^0.2.2"
12 | },
13 | "devDependencies": {
14 | "del": "^5.1.0",
15 | "gulp": "^4.0.2",
16 | "gulp-cache": "^1.1.3",
17 | "gulp-changed": "^4.0.2",
18 | "gulp-if": "^3.0.0",
19 | "gulp-image": "^6.1.0",
20 | "gulp-less": "^4.0.1",
21 | "gulp-mp-npm": "^1.5.0",
22 | "gulp-rename": "^2.0.0",
23 | "gulp-sourcemaps": "^2.6.5",
24 | "gulp-typescript": "^6.0.0-alpha.1",
25 | "jsonfile": "^6.0.1",
26 | "miniprogram-api-typings": "latest",
27 | "typescript": "^3.8.3"
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/checkbox/checkbox.wxss:
--------------------------------------------------------------------------------
1 | .weui-cell_radio .weui-check + .weui-icon-checked{color:transparent}.weui-check[checked] + .weui-icon-checked{color:var(--weui-BRAND);-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.657%2018.435L3%2012.778l1.414-1.414%204.95%204.95L20.678%205l1.414%201.414-12.02%2012.021a1%201%200%2001-1.415%200z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.657%2018.435L3%2012.778l1.414-1.414%204.95%204.95L20.678%205l1.414%201.414-12.02%2012.021a1%201%200%2001-1.415%200z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E)}
2 |
3 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/miniprogram_npm/weui-miniprogram/checkbox/checkbox.wxss:
--------------------------------------------------------------------------------
1 | .weui-cell_radio .weui-check + .weui-icon-checked{color:transparent}.weui-check[checked] + .weui-icon-checked{color:var(--weui-BRAND);-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.657%2018.435L3%2012.778l1.414-1.414%204.95%204.95L20.678%205l1.414%201.414-12.02%2012.021a1%201%200%2001-1.415%200z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.657%2018.435L3%2012.778l1.414-1.414%204.95%204.95L20.678%205l1.414%201.414-12.02%2012.021a1%201%200%2001-1.415%200z%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E)}
2 |
3 |
--------------------------------------------------------------------------------
/test/expected/integration-test/default/app.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"sources":["app.ts"],"names":[],"mappings":";;AACA,uCAAqC;AAErC,GAAG,CAAC;IAGA,QAAQ,YAAC,OAAO;QACZ,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;IAC7C,CAAC;IAED,MAAM,gBAAK,CAAC;IAEZ,MAAM,gBAAK,CAAC;IAEZ,OAAO,gBAAK,CAAC;IAEb,cAAc,gBAAK,CAAC;IAGpB,UAAU,EAAE,EAAG;IAEf,OAAO,EAAE,IAAA,YAAI,GAAE;CAIlB,CAAC,CAAC","file":"app.js","sourcesContent":["// app.ts\nimport { mitt } from './utils/index';\n\nApp({\n /* 生命周期 */\n // 小程序初始化完成时触发,全局只触发一次\n onLaunch(options) {\n console.log('onLaunch options', options);\n },\n // 小程序启动,或从后台进入前台显示时触发\n onShow() { },\n // 小程序从前台进入后台时触发\n onHide() { },\n // 小程序发生脚本错误或 API 调用报错时触发\n onError() { },\n // 小程序要打开的页面不存在时触发\n onPageNotFound() { },\n\n /* Global Data */\n globalData: { },\n\n emitter: mitt(),\n\n /* Global Methods */\n\n});\n"]}
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/lodash/isSymbol.js:
--------------------------------------------------------------------------------
1 | var baseGetTag = require('./_baseGetTag'),
2 | isObjectLike = require('./isObjectLike');
3 |
4 | /** `Object#toString` result references. */
5 | var symbolTag = '[object Symbol]';
6 |
7 | /**
8 | * Checks if `value` is classified as a `Symbol` primitive or object.
9 | *
10 | * @static
11 | * @memberOf _
12 | * @since 4.0.0
13 | * @category Lang
14 | * @param {*} value The value to check.
15 | * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
16 | * @example
17 | *
18 | * _.isSymbol(Symbol.iterator);
19 | * // => true
20 | *
21 | * _.isSymbol('abc');
22 | * // => false
23 | */
24 | function isSymbol(value) {
25 | return typeof value == 'symbol' ||
26 | (isObjectLike(value) && baseGetTag(value) == symbolTag);
27 | }
28 |
29 | module.exports = isSymbol;
30 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/lodash/isSymbol.js:
--------------------------------------------------------------------------------
1 | var baseGetTag = require('./_baseGetTag'),
2 | isObjectLike = require('./isObjectLike');
3 |
4 | /** `Object#toString` result references. */
5 | var symbolTag = '[object Symbol]';
6 |
7 | /**
8 | * Checks if `value` is classified as a `Symbol` primitive or object.
9 | *
10 | * @static
11 | * @memberOf _
12 | * @since 4.0.0
13 | * @category Lang
14 | * @param {*} value The value to check.
15 | * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
16 | * @example
17 | *
18 | * _.isSymbol(Symbol.iterator);
19 | * // => true
20 | *
21 | * _.isSymbol('abc');
22 | * // => false
23 | */
24 | function isSymbol(value) {
25 | return typeof value == 'symbol' ||
26 | (isObjectLike(value) && baseGetTag(value) == symbolTag);
27 | }
28 |
29 | module.exports = isSymbol;
30 |
--------------------------------------------------------------------------------
/test/expected/integration-test/customize-npmDirname/app.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"sources":["app.ts"],"names":[],"mappings":";;AACA,uCAAqC;AAErC,GAAG,CAAC;IAGA,QAAQ,YAAC,OAAO;QACZ,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;IAC7C,CAAC;IAED,MAAM,gBAAK,CAAC;IAEZ,MAAM,gBAAK,CAAC;IAEZ,OAAO,gBAAK,CAAC;IAEb,cAAc,gBAAK,CAAC;IAGpB,UAAU,EAAE,EAAG;IAEf,OAAO,EAAE,IAAA,YAAI,GAAE;CAIlB,CAAC,CAAC","file":"app.js","sourcesContent":["// app.ts\nimport { mitt } from './utils/index';\n\nApp({\n /* 生命周期 */\n // 小程序初始化完成时触发,全局只触发一次\n onLaunch(options) {\n console.log('onLaunch options', options);\n },\n // 小程序启动,或从后台进入前台显示时触发\n onShow() { },\n // 小程序从前台进入后台时触发\n onHide() { },\n // 小程序发生脚本错误或 API 调用报错时触发\n onError() { },\n // 小程序要打开的页面不存在时触发\n onPageNotFound() { },\n\n /* Global Data */\n globalData: { },\n\n emitter: mitt(),\n\n /* Global Methods */\n\n});\n"]}
--------------------------------------------------------------------------------
/test/expected/unit-test/import-normal-dep.js/miniprogram_npm/lodash/isSymbol.js:
--------------------------------------------------------------------------------
1 | var baseGetTag = require('./_baseGetTag'),
2 | isObjectLike = require('./isObjectLike');
3 |
4 | /** `Object#toString` result references. */
5 | var symbolTag = '[object Symbol]';
6 |
7 | /**
8 | * Checks if `value` is classified as a `Symbol` primitive or object.
9 | *
10 | * @static
11 | * @memberOf _
12 | * @since 4.0.0
13 | * @category Lang
14 | * @param {*} value The value to check.
15 | * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
16 | * @example
17 | *
18 | * _.isSymbol(Symbol.iterator);
19 | * // => true
20 | *
21 | * _.isSymbol('abc');
22 | * // => false
23 | */
24 | function isSymbol(value) {
25 | return typeof value == 'symbol' ||
26 | (isObjectLike(value) && baseGetTag(value) == symbolTag);
27 | }
28 |
29 | module.exports = isSymbol;
30 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/lodash/_isIndex.js:
--------------------------------------------------------------------------------
1 | /** Used as references for various `Number` constants. */
2 | var MAX_SAFE_INTEGER = 9007199254740991;
3 |
4 | /** Used to detect unsigned integer values. */
5 | var reIsUint = /^(?:0|[1-9]\d*)$/;
6 |
7 | /**
8 | * Checks if `value` is a valid array-like index.
9 | *
10 | * @private
11 | * @param {*} value The value to check.
12 | * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
13 | * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
14 | */
15 | function isIndex(value, length) {
16 | var type = typeof value;
17 | length = length == null ? MAX_SAFE_INTEGER : length;
18 |
19 | return !!length &&
20 | (type == 'number' ||
21 | (type != 'symbol' && reIsUint.test(value))) &&
22 | (value > -1 && value % 1 == 0 && value < length);
23 | }
24 |
25 | module.exports = isIndex;
26 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/lodash/_isIndex.js:
--------------------------------------------------------------------------------
1 | /** Used as references for various `Number` constants. */
2 | var MAX_SAFE_INTEGER = 9007199254740991;
3 |
4 | /** Used to detect unsigned integer values. */
5 | var reIsUint = /^(?:0|[1-9]\d*)$/;
6 |
7 | /**
8 | * Checks if `value` is a valid array-like index.
9 | *
10 | * @private
11 | * @param {*} value The value to check.
12 | * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
13 | * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
14 | */
15 | function isIndex(value, length) {
16 | var type = typeof value;
17 | length = length == null ? MAX_SAFE_INTEGER : length;
18 |
19 | return !!length &&
20 | (type == 'number' ||
21 | (type != 'symbol' && reIsUint.test(value))) &&
22 | (value > -1 && value % 1 == 0 && value < length);
23 | }
24 |
25 | module.exports = isIndex;
26 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/lodash/isObject.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Checks if `value` is the
3 | * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
4 | * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
5 | *
6 | * @static
7 | * @memberOf _
8 | * @since 0.1.0
9 | * @category Lang
10 | * @param {*} value The value to check.
11 | * @returns {boolean} Returns `true` if `value` is an object, else `false`.
12 | * @example
13 | *
14 | * _.isObject({});
15 | * // => true
16 | *
17 | * _.isObject([1, 2, 3]);
18 | * // => true
19 | *
20 | * _.isObject(_.noop);
21 | * // => true
22 | *
23 | * _.isObject(null);
24 | * // => false
25 | */
26 | function isObject(value) {
27 | var type = typeof value;
28 | return value != null && (type == 'object' || type == 'function');
29 | }
30 |
31 | module.exports = isObject;
32 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/lodash/isObject.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Checks if `value` is the
3 | * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
4 | * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
5 | *
6 | * @static
7 | * @memberOf _
8 | * @since 0.1.0
9 | * @category Lang
10 | * @param {*} value The value to check.
11 | * @returns {boolean} Returns `true` if `value` is an object, else `false`.
12 | * @example
13 | *
14 | * _.isObject({});
15 | * // => true
16 | *
17 | * _.isObject([1, 2, 3]);
18 | * // => true
19 | *
20 | * _.isObject(_.noop);
21 | * // => true
22 | *
23 | * _.isObject(null);
24 | * // => false
25 | */
26 | function isObject(value) {
27 | var type = typeof value;
28 | return value != null && (type == 'object' || type == 'function');
29 | }
30 |
31 | module.exports = isObject;
32 |
--------------------------------------------------------------------------------
/lib/utils/getPackageName.js:
--------------------------------------------------------------------------------
1 | // 通过路径或表达式解析模块名
2 | const path = require('path');
3 | const { slash } = require('./index');
4 | const getNodeModulesPath = require('./getNodeModulesPath');
5 |
6 | module.exports = (filepath = '') => {
7 | filepath = slash(filepath);
8 |
9 | const nodeModulesPath = getNodeModulesPath(filepath);
10 | // 如果为路径, 则找到在 node_modules 下的相对路径
11 | if (nodeModulesPath) filepath = path.posix.relative(nodeModulesPath, filepath);
12 |
13 | let packageName = '';
14 | if (filepath[0] !== '/') {
15 | const parts = filepath.split('/');
16 | if (parts.length > 0 && parts[0][0] === '@') {
17 | packageName += `${parts.shift()}/`;
18 | }
19 | packageName += parts.shift();
20 | }
21 | // 如果 packageName 为 . 或 .. 则置为空
22 | if (['.', '..'].includes(packageName)) {
23 | packageName = '';
24 | }
25 |
26 | return packageName;
27 | };
28 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-normal-dep.js/miniprogram_npm/lodash/_isIndex.js:
--------------------------------------------------------------------------------
1 | /** Used as references for various `Number` constants. */
2 | var MAX_SAFE_INTEGER = 9007199254740991;
3 |
4 | /** Used to detect unsigned integer values. */
5 | var reIsUint = /^(?:0|[1-9]\d*)$/;
6 |
7 | /**
8 | * Checks if `value` is a valid array-like index.
9 | *
10 | * @private
11 | * @param {*} value The value to check.
12 | * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
13 | * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
14 | */
15 | function isIndex(value, length) {
16 | var type = typeof value;
17 | length = length == null ? MAX_SAFE_INTEGER : length;
18 |
19 | return !!length &&
20 | (type == 'number' ||
21 | (type != 'symbol' && reIsUint.test(value))) &&
22 | (value > -1 && value % 1 == 0 && value < length);
23 | }
24 |
25 | module.exports = isIndex;
26 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-normal-dep.js/miniprogram_npm/lodash/isObject.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Checks if `value` is the
3 | * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
4 | * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
5 | *
6 | * @static
7 | * @memberOf _
8 | * @since 0.1.0
9 | * @category Lang
10 | * @param {*} value The value to check.
11 | * @returns {boolean} Returns `true` if `value` is an object, else `false`.
12 | * @example
13 | *
14 | * _.isObject({});
15 | * // => true
16 | *
17 | * _.isObject([1, 2, 3]);
18 | * // => true
19 | *
20 | * _.isObject(_.noop);
21 | * // => true
22 | *
23 | * _.isObject(null);
24 | * // => false
25 | */
26 | function isObject(value) {
27 | var type = typeof value;
28 | return value != null && (type == 'object' || type == 'function');
29 | }
30 |
31 | module.exports = isObject;
32 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/lodash/_Hash.js:
--------------------------------------------------------------------------------
1 | var hashClear = require('./_hashClear'),
2 | hashDelete = require('./_hashDelete'),
3 | hashGet = require('./_hashGet'),
4 | hashHas = require('./_hashHas'),
5 | hashSet = require('./_hashSet');
6 |
7 | /**
8 | * Creates a hash object.
9 | *
10 | * @private
11 | * @constructor
12 | * @param {Array} [entries] The key-value pairs to cache.
13 | */
14 | function Hash(entries) {
15 | var index = -1,
16 | length = entries == null ? 0 : entries.length;
17 |
18 | this.clear();
19 | while (++index < length) {
20 | var entry = entries[index];
21 | this.set(entry[0], entry[1]);
22 | }
23 | }
24 |
25 | // Add methods to `Hash`.
26 | Hash.prototype.clear = hashClear;
27 | Hash.prototype['delete'] = hashDelete;
28 | Hash.prototype.get = hashGet;
29 | Hash.prototype.has = hashHas;
30 | Hash.prototype.set = hashSet;
31 |
32 | module.exports = Hash;
33 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/lodash/_Hash.js:
--------------------------------------------------------------------------------
1 | var hashClear = require('./_hashClear'),
2 | hashDelete = require('./_hashDelete'),
3 | hashGet = require('./_hashGet'),
4 | hashHas = require('./_hashHas'),
5 | hashSet = require('./_hashSet');
6 |
7 | /**
8 | * Creates a hash object.
9 | *
10 | * @private
11 | * @constructor
12 | * @param {Array} [entries] The key-value pairs to cache.
13 | */
14 | function Hash(entries) {
15 | var index = -1,
16 | length = entries == null ? 0 : entries.length;
17 |
18 | this.clear();
19 | while (++index < length) {
20 | var entry = entries[index];
21 | this.set(entry[0], entry[1]);
22 | }
23 | }
24 |
25 | // Add methods to `Hash`.
26 | Hash.prototype.clear = hashClear;
27 | Hash.prototype['delete'] = hashDelete;
28 | Hash.prototype.get = hashGet;
29 | Hash.prototype.has = hashHas;
30 | Hash.prototype.set = hashSet;
31 |
32 | module.exports = Hash;
33 |
--------------------------------------------------------------------------------
/test/expected/unit-test/import-normal-dep.js/miniprogram_npm/lodash/_Hash.js:
--------------------------------------------------------------------------------
1 | var hashClear = require('./_hashClear'),
2 | hashDelete = require('./_hashDelete'),
3 | hashGet = require('./_hashGet'),
4 | hashHas = require('./_hashHas'),
5 | hashSet = require('./_hashSet');
6 |
7 | /**
8 | * Creates a hash object.
9 | *
10 | * @private
11 | * @constructor
12 | * @param {Array} [entries] The key-value pairs to cache.
13 | */
14 | function Hash(entries) {
15 | var index = -1,
16 | length = entries == null ? 0 : entries.length;
17 |
18 | this.clear();
19 | while (++index < length) {
20 | var entry = entries[index];
21 | this.set(entry[0], entry[1]);
22 | }
23 | }
24 |
25 | // Add methods to `Hash`.
26 | Hash.prototype.clear = hashClear;
27 | Hash.prototype['delete'] = hashDelete;
28 | Hash.prototype.get = hashGet;
29 | Hash.prototype.has = hashHas;
30 | Hash.prototype.set = hashSet;
31 |
32 | module.exports = Hash;
33 |
--------------------------------------------------------------------------------
/test/expected/unit-test/customize-npmDirname/dist/lodash/_hashGet.js:
--------------------------------------------------------------------------------
1 | var nativeCreate = require('./_nativeCreate');
2 |
3 | /** Used to stand-in for `undefined` hash values. */
4 | var HASH_UNDEFINED = '__lodash_hash_undefined__';
5 |
6 | /** Used for built-in method references. */
7 | var objectProto = Object.prototype;
8 |
9 | /** Used to check objects for own properties. */
10 | var hasOwnProperty = objectProto.hasOwnProperty;
11 |
12 | /**
13 | * Gets the hash value for `key`.
14 | *
15 | * @private
16 | * @name get
17 | * @memberOf Hash
18 | * @param {string} key The key of the value to get.
19 | * @returns {*} Returns the entry value.
20 | */
21 | function hashGet(key) {
22 | var data = this.__data__;
23 | if (nativeCreate) {
24 | var result = data[key];
25 | return result === HASH_UNDEFINED ? undefined : result;
26 | }
27 | return hasOwnProperty.call(data, key) ? data[key] : undefined;
28 | }
29 |
30 | module.exports = hashGet;
31 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/lodash/_hashGet.js:
--------------------------------------------------------------------------------
1 | var nativeCreate = require('./_nativeCreate');
2 |
3 | /** Used to stand-in for `undefined` hash values. */
4 | var HASH_UNDEFINED = '__lodash_hash_undefined__';
5 |
6 | /** Used for built-in method references. */
7 | var objectProto = Object.prototype;
8 |
9 | /** Used to check objects for own properties. */
10 | var hasOwnProperty = objectProto.hasOwnProperty;
11 |
12 | /**
13 | * Gets the hash value for `key`.
14 | *
15 | * @private
16 | * @name get
17 | * @memberOf Hash
18 | * @param {string} key The key of the value to get.
19 | * @returns {*} Returns the entry value.
20 | */
21 | function hashGet(key) {
22 | var data = this.__data__;
23 | if (nativeCreate) {
24 | var result = data[key];
25 | return result === HASH_UNDEFINED ? undefined : result;
26 | }
27 | return hasOwnProperty.call(data, key) ? data[key] : undefined;
28 | }
29 |
30 | module.exports = hashGet;
31 |
--------------------------------------------------------------------------------
/test/expected/unit-test/options-fullExtract/dist/weui-miniprogram/half-screen-dialog/half-screen-dialog.js:
--------------------------------------------------------------------------------
1 | var globalThis=this,self=this;module.exports=require("../_commons/0.js")([{ids:[12],modules:{12:function(e,t,s){e.exports=s(125)},125:function(e,t){Component({options:{multipleSlots:!0,addGlobalClass:!0},properties:{closabled:{type:Boolean,value:!0},title:{type:String,value:""},subTitle:{type:String,value:""},extClass:{type:String,value:""},desc:{type:String,value:""},tips:{type:String,value:""},maskClosable:{type:Boolean,value:!0},mask:{type:Boolean,value:!0},show:{type:Boolean,value:!1,observer:"_showChange"},buttons:{type:Array,value:[]}},methods:{close:function(e){var t=e.currentTarget.dataset.type;(this.data.maskClosable||"close"===t)&&(this.setData({show:!1}),this.triggerEvent("close"))},buttonTap:function(e){var t=e.currentTarget.dataset.index;this.triggerEvent("buttontap",{index:t,item:this.data.buttons[t]},{})},onMaskMouseMove:function(){}}})}},entries:[[12,0]]}]);
--------------------------------------------------------------------------------
/test/fixtures/integration-test/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "strictNullChecks": true,
4 | "noImplicitAny": false,
5 | "module": "CommonJS",
6 | "target": "ES5",
7 | "allowJs": false,
8 | "experimentalDecorators": true,
9 | "noImplicitThis": true,
10 | "noImplicitReturns": true,
11 | "alwaysStrict": true,
12 | "inlineSourceMap": true,
13 | "inlineSources": true,
14 | "noFallthroughCasesInSwitch": true,
15 | "noUnusedLocals": true,
16 | "noUnusedParameters": true,
17 | "strict": true,
18 | "removeComments": true,
19 | "pretty": true,
20 | "strictPropertyInitialization": true,
21 | "lib": [
22 | "es5",
23 | "es6",
24 | "scripthost"
25 | ],
26 | "typeRoots": [
27 | "../../../node_modules/miniprogram-api-typings"
28 | ]
29 | },
30 | "include": [
31 | "./**/*.ts"
32 | ],
33 | "exclude": [
34 | "node_modules"
35 | ]
36 | }
37 |
--------------------------------------------------------------------------------