updated 添加esModule支持
This commit is contained in:
parent
e8208fd778
commit
c83716cdfa
@ -1,4 +1,13 @@
|
||||
module.exports = {
|
||||
presets: ['@babel/preset-env'],
|
||||
plugins: ['@babel/plugin-transform-runtime', '@babel/plugin-proposal-class-properties']
|
||||
}
|
||||
plugins: [
|
||||
'@babel/plugin-transform-runtime',
|
||||
'@babel/plugin-transform-class-properties',
|
||||
[
|
||||
'@babel/plugin-syntax-import-attributes',
|
||||
{
|
||||
deprecatedAssertSyntax: true
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
|
@ -1 +1,13 @@
|
||||
/*!
|
||||
* relationship.js v1.2.3
|
||||
* Chinese kinship library
|
||||
* https://passer-by.com/relationship/
|
||||
*
|
||||
* Copyright (c) 2016-present, HaoLe Zheng
|
||||
*
|
||||
* Released under the MIT License
|
||||
* https://github.com/mumuy/relationship
|
||||
*
|
||||
* Created on: 2023-10-27
|
||||
*/
|
||||
!function(f,s){"object"==typeof exports&&"undefined"!=typeof module?module.exports=s():"function"==typeof define&&define.amd?define(s):(f="undefined"!=typeof globalThis?globalThis:f||self).relationshipMode=s()}(this,(function(){"use strict";function f(s){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(f){return typeof f}:function(f){return f&&"function"==typeof Symbol&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f},f(s)}function s(s){var m=function(s,m){if("object"!==f(s)||null===s)return s;var o=s[Symbol.toPrimitive];if(void 0!==o){var d=o.call(s,m||"default");if("object"!==f(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===m?String:Number)(s)}(s,"string");return"symbol"===f(m)?m:String(m)}function m(f,m,o){return(m=s(m))in f?Object.defineProperty(f,m,{value:o,enumerable:!0,configurable:!0,writable:!0}):f[m]=o,f}var o;return{guangdong:{name:"廣東",data:(o={f:["老竇"],"f,f":["阿爺"],"f,f,f":["太公"],"f,f,m":["太婆"],"f,m":["阿嫲"],"f,m,f":["太外公"],"f,m,m":["太外婆"],"f,ob":["伯伯"],"f,ob,w":["伯娘"],"f,lb":["阿叔"],"f,lb,w":["阿嬸"],"0,f,xb,d,s":["堂姨甥"],"1,f,xb,d,s":["堂外甥"],"0,f,xb,d,d":["堂姨甥女"],"1,f,xb,d,d":["堂外甥女"],"f,os":["姑母"],"f,ls":["姑姐"],"f,xs,h":["姑丈"],"0,f,xs,d,s":["姑表姨甥"],"1,f,xs,d,s":["姑表外甥"],"0,f,xs,d,d":["姑表姨甥女"],"1,f,xs,d,d":["姑表外甥女"],m:["老母"],"m,f":["阿公"],"m,f,f":["外太公"],"m,f,m":["外太婆"],"m,m":["阿婆"],"m,m,f":["外太外公"],"m,m,m":["外太外婆"],"m,ob":["舅父"],"m,lb":["舅仔"],"m,xb,w":["舅母"],"0,m,xb,d,s":["舅表姨甥"],"1,m,xb,d,s":["舅表外甥"],"0,m,xb,d,d":["舅表姨甥女"],"1,m,xb,d,d":["舅表外甥女"],"m,os":["姨媽"],"m,ls":["姨仔"],"m,xs,h":["姨丈"]},m(o,"0,m,xb,d,s",["姨姨甥"]),m(o,"1,m,xb,d,s",["姨外甥"]),m(o,"0,m,xb,d,d",["姨姨甥女"]),m(o,"1,m,xb,d,d",["姨外甥女"]),m(o,"ob",["大佬"]),m(o,"ob,w",["阿嫂"]),m(o,"lb",["細佬"]),m(o,"lb,w",["弟婦"]),m(o,"xb,s",["侄"]),m(o,"xb,d",["侄女"]),m(o,"os",["家姐"]),m(o,"os,h",["姐夫"]),m(o,"ls",["阿妹"]),m(o,"ls,h",["妹夫"]),m(o,"0,xs,s",["姨甥"]),m(o,"1,xs,s",["外甥"]),m(o,"0,xs,d",["姨甥女"]),m(o,"1,xs,d",["外甥女"]),m(o,"s",["仔"]),m(o,"s,w",["新婦"]),m(o,"s,s",["孫"]),m(o,"s,s,w",["孫新婦"]),m(o,"s,s,s",["息仔"]),m(o,"s,s,d",["息女"]),m(o,"s,d",["孫女"]),m(o,"s,d,h",["孫女婿"]),m(o,"s,d,s",["外息仔"]),m(o,"s,d,d",["外息女"]),m(o,"d",["女"]),m(o,"d,s",["外孫"]),m(o,"d,s,w",["外孫新婦"]),m(o,"d,s,s",["外息仔"]),m(o,"d,s,d",["外息女"]),m(o,"d,d",["外孫女"]),m(o,"d,d,h",["外孫女婿"]),m(o,"d,d,s",["外息仔"]),m(o,"d,d,d",["外息女"]),o)},north:{name:"北方",data:{"m,m":["姥姥"],"m,m,xs":["姨姥姥"],"m,m,xs,h":["姨姥爺"],"m,m,xb":["舅姥爺"],"m,m,xb,w":["舅姥姥"],"m,f":["姥爺"],"m,f,xs":["姑姥姥"],"m,f,xs,h":["姑姥爺"],"m,f,ob":["大姥爺"],"m,f,ob,w":["大姥姥"],"m,f,lb":["小姥爺"],"m,f,lb,w":["小姥姥"],"f,ob":["大爺"],"f,ob,w":["大娘"]}}}}));
|
13
dist/lang/relationship-mode.zh-HK.min.mjs
vendored
Normal file
13
dist/lang/relationship-mode.zh-HK.min.mjs
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
/*!
|
||||
* relationship.js v1.2.3
|
||||
* Chinese kinship library
|
||||
* https://passer-by.com/relationship/
|
||||
*
|
||||
* Copyright (c) 2016-present, HaoLe Zheng
|
||||
*
|
||||
* Released under the MIT License
|
||||
* https://github.com/mumuy/relationship
|
||||
*
|
||||
* Created on: 2023-10-27
|
||||
*/
|
||||
function m(s){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(m){return typeof m}:function(m){return m&&"function"==typeof Symbol&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},m(s)}function s(s){var f=function(s,f){if("object"!==m(s)||null===s)return s;var d=s[Symbol.toPrimitive];if(void 0!==d){var o=d.call(s,f||"default");if("object"!==m(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===f?String:Number)(s)}(s,"string");return"symbol"===m(f)?f:String(f)}function f(m,f,d){return(f=s(f))in m?Object.defineProperty(m,f,{value:d,enumerable:!0,configurable:!0,writable:!0}):m[f]=d,m}var d,o={guangdong:{name:"廣東",data:(d={f:["老竇"],"f,f":["阿爺"],"f,f,f":["太公"],"f,f,m":["太婆"],"f,m":["阿嫲"],"f,m,f":["太外公"],"f,m,m":["太外婆"],"f,ob":["伯伯"],"f,ob,w":["伯娘"],"f,lb":["阿叔"],"f,lb,w":["阿嬸"],"0,f,xb,d,s":["堂姨甥"],"1,f,xb,d,s":["堂外甥"],"0,f,xb,d,d":["堂姨甥女"],"1,f,xb,d,d":["堂外甥女"],"f,os":["姑母"],"f,ls":["姑姐"],"f,xs,h":["姑丈"],"0,f,xs,d,s":["姑表姨甥"],"1,f,xs,d,s":["姑表外甥"],"0,f,xs,d,d":["姑表姨甥女"],"1,f,xs,d,d":["姑表外甥女"],m:["老母"],"m,f":["阿公"],"m,f,f":["外太公"],"m,f,m":["外太婆"],"m,m":["阿婆"],"m,m,f":["外太外公"],"m,m,m":["外太外婆"],"m,ob":["舅父"],"m,lb":["舅仔"],"m,xb,w":["舅母"],"0,m,xb,d,s":["舅表姨甥"],"1,m,xb,d,s":["舅表外甥"],"0,m,xb,d,d":["舅表姨甥女"],"1,m,xb,d,d":["舅表外甥女"],"m,os":["姨媽"],"m,ls":["姨仔"],"m,xs,h":["姨丈"]},f(d,"0,m,xb,d,s",["姨姨甥"]),f(d,"1,m,xb,d,s",["姨外甥"]),f(d,"0,m,xb,d,d",["姨姨甥女"]),f(d,"1,m,xb,d,d",["姨外甥女"]),f(d,"ob",["大佬"]),f(d,"ob,w",["阿嫂"]),f(d,"lb",["細佬"]),f(d,"lb,w",["弟婦"]),f(d,"xb,s",["侄"]),f(d,"xb,d",["侄女"]),f(d,"os",["家姐"]),f(d,"os,h",["姐夫"]),f(d,"ls",["阿妹"]),f(d,"ls,h",["妹夫"]),f(d,"0,xs,s",["姨甥"]),f(d,"1,xs,s",["外甥"]),f(d,"0,xs,d",["姨甥女"]),f(d,"1,xs,d",["外甥女"]),f(d,"s",["仔"]),f(d,"s,w",["新婦"]),f(d,"s,s",["孫"]),f(d,"s,s,w",["孫新婦"]),f(d,"s,s,s",["息仔"]),f(d,"s,s,d",["息女"]),f(d,"s,d",["孫女"]),f(d,"s,d,h",["孫女婿"]),f(d,"s,d,s",["外息仔"]),f(d,"s,d,d",["外息女"]),f(d,"d",["女"]),f(d,"d,s",["外孫"]),f(d,"d,s,w",["外孫新婦"]),f(d,"d,s,s",["外息仔"]),f(d,"d,s,d",["外息女"]),f(d,"d,d",["外孫女"]),f(d,"d,d,h",["外孫女婿"]),f(d,"d,d,s",["外息仔"]),f(d,"d,d,d",["外息女"]),d)},north:{name:"北方",data:{"m,m":["姥姥"],"m,m,xs":["姨姥姥"],"m,m,xs,h":["姨姥爺"],"m,m,xb":["舅姥爺"],"m,m,xb,w":["舅姥姥"],"m,f":["姥爺"],"m,f,xs":["姑姥姥"],"m,f,xs,h":["姑姥爺"],"m,f,ob":["大姥爺"],"m,f,ob,w":["大姥姥"],"m,f,lb":["小姥爺"],"m,f,lb,w":["小姥姥"],"f,ob":["大爺"],"f,ob,w":["大娘"]}}};export{o as default};
|
File diff suppressed because one or more lines are too long
13
dist/lang/relationship.zh-HK.min.mjs
vendored
Normal file
13
dist/lang/relationship.zh-HK.min.mjs
vendored
Normal file
File diff suppressed because one or more lines are too long
12
dist/relationship-mode.min.js
vendored
12
dist/relationship-mode.min.js
vendored
@ -1 +1,13 @@
|
||||
/*!
|
||||
* relationship.js v1.2.3
|
||||
* Chinese kinship library
|
||||
* https://passer-by.com/relationship/
|
||||
*
|
||||
* Copyright (c) 2016-present, HaoLe Zheng
|
||||
*
|
||||
* Released under the MIT License
|
||||
* https://github.com/mumuy/relationship
|
||||
*
|
||||
* Created on: 2023-10-27
|
||||
*/
|
||||
!function(f,s){"object"==typeof exports&&"undefined"!=typeof module?module.exports=s():"function"==typeof define&&define.amd?define(s):(f="undefined"!=typeof globalThis?globalThis:f||self).relationshipMode=s()}(this,(function(){"use strict";function f(s){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(f){return typeof f}:function(f){return f&&"function"==typeof Symbol&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f},f(s)}function s(s){var m=function(s,m){if("object"!==f(s)||null===s)return s;var o=s[Symbol.toPrimitive];if(void 0!==o){var d=o.call(s,m||"default");if("object"!==f(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===m?String:Number)(s)}(s,"string");return"symbol"===f(m)?m:String(m)}function m(f,m,o){return(m=s(m))in f?Object.defineProperty(f,m,{value:o,enumerable:!0,configurable:!0,writable:!0}):f[m]=o,f}var o;return{guangdong:{name:"广东",data:(o={f:["老窦"],"f,f":["阿爷"],"f,f,f":["太公"],"f,f,m":["太婆"],"f,m":["阿嫲"],"f,m,f":["太外公"],"f,m,m":["太外婆"],"f,ob":["伯伯"],"f,ob,w":["伯娘"],"f,lb":["阿叔"],"f,lb,w":["阿婶"],"0,f,xb,d,s":["堂姨甥"],"1,f,xb,d,s":["堂外甥"],"0,f,xb,d,d":["堂姨甥女"],"1,f,xb,d,d":["堂外甥女"],"f,os":["姑母"],"f,ls":["姑姐"],"f,xs,h":["姑丈"],"0,f,xs,d,s":["姑表姨甥"],"1,f,xs,d,s":["姑表外甥"],"0,f,xs,d,d":["姑表姨甥女"],"1,f,xs,d,d":["姑表外甥女"],m:["老母"],"m,f":["阿公"],"m,f,f":["外太公"],"m,f,m":["外太婆"],"m,m":["阿婆"],"m,m,f":["外太外公"],"m,m,m":["外太外婆"],"m,ob":["舅父"],"m,lb":["舅仔"],"m,xb,w":["舅母"],"0,m,xb,d,s":["舅表姨甥"],"1,m,xb,d,s":["舅表外甥"],"0,m,xb,d,d":["舅表姨甥女"],"1,m,xb,d,d":["舅表外甥女"],"m,os":["姨妈"],"m,ls":["姨仔"],"m,xs,h":["姨丈"]},m(o,"0,m,xb,d,s",["姨姨甥"]),m(o,"1,m,xb,d,s",["姨外甥"]),m(o,"0,m,xb,d,d",["姨姨甥女"]),m(o,"1,m,xb,d,d",["姨外甥女"]),m(o,"ob",["大佬"]),m(o,"ob,w",["阿嫂"]),m(o,"lb",["细佬"]),m(o,"lb,w",["弟妇"]),m(o,"xb,s",["侄"]),m(o,"xb,d",["侄女"]),m(o,"os",["家姐"]),m(o,"os,h",["姐夫"]),m(o,"ls",["阿妹"]),m(o,"ls,h",["妹夫"]),m(o,"0,xs,s",["姨甥"]),m(o,"1,xs,s",["外甥"]),m(o,"0,xs,d",["姨甥女"]),m(o,"1,xs,d",["外甥女"]),m(o,"s",["仔"]),m(o,"s,w",["新妇"]),m(o,"s,s",["孙"]),m(o,"s,s,w",["孙新妇"]),m(o,"s,s,s",["息仔"]),m(o,"s,s,d",["息女"]),m(o,"s,d",["孙女"]),m(o,"s,d,h",["孙女婿"]),m(o,"s,d,s",["外息仔"]),m(o,"s,d,d",["外息女"]),m(o,"d",["女"]),m(o,"d,s",["外孙"]),m(o,"d,s,w",["外孙新妇"]),m(o,"d,s,s",["外息仔"]),m(o,"d,s,d",["外息女"]),m(o,"d,d",["外孙女"]),m(o,"d,d,h",["外孙女婿"]),m(o,"d,d,s",["外息仔"]),m(o,"d,d,d",["外息女"]),o)},north:{name:"北方",data:{"m,m":["姥姥"],"m,m,xs":["姨姥姥"],"m,m,xs,h":["姨姥爷"],"m,m,xb":["舅姥爷"],"m,m,xb,w":["舅姥姥"],"m,f":["姥爷"],"m,f,xs":["姑姥姥"],"m,f,xs,h":["姑姥爷"],"m,f,ob":["大姥爷"],"m,f,ob,w":["大姥姥"],"m,f,lb":["小姥爷"],"m,f,lb,w":["小姥姥"],"f,ob":["大爷"],"f,ob,w":["大娘"]}}}}));
|
||||
|
13
dist/relationship-mode.min.mjs
vendored
Normal file
13
dist/relationship-mode.min.mjs
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
/*!
|
||||
* relationship.js v1.2.3
|
||||
* Chinese kinship library
|
||||
* https://passer-by.com/relationship/
|
||||
*
|
||||
* Copyright (c) 2016-present, HaoLe Zheng
|
||||
*
|
||||
* Released under the MIT License
|
||||
* https://github.com/mumuy/relationship
|
||||
*
|
||||
* Created on: 2023-10-27
|
||||
*/
|
||||
function m(s){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(m){return typeof m}:function(m){return m&&"function"==typeof Symbol&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},m(s)}function s(s){var f=function(s,f){if("object"!==m(s)||null===s)return s;var d=s[Symbol.toPrimitive];if(void 0!==d){var o=d.call(s,f||"default");if("object"!==m(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===f?String:Number)(s)}(s,"string");return"symbol"===m(f)?f:String(f)}function f(m,f,d){return(f=s(f))in m?Object.defineProperty(m,f,{value:d,enumerable:!0,configurable:!0,writable:!0}):m[f]=d,m}var d,o={guangdong:{name:"广东",data:(d={f:["老窦"],"f,f":["阿爷"],"f,f,f":["太公"],"f,f,m":["太婆"],"f,m":["阿嫲"],"f,m,f":["太外公"],"f,m,m":["太外婆"],"f,ob":["伯伯"],"f,ob,w":["伯娘"],"f,lb":["阿叔"],"f,lb,w":["阿婶"],"0,f,xb,d,s":["堂姨甥"],"1,f,xb,d,s":["堂外甥"],"0,f,xb,d,d":["堂姨甥女"],"1,f,xb,d,d":["堂外甥女"],"f,os":["姑母"],"f,ls":["姑姐"],"f,xs,h":["姑丈"],"0,f,xs,d,s":["姑表姨甥"],"1,f,xs,d,s":["姑表外甥"],"0,f,xs,d,d":["姑表姨甥女"],"1,f,xs,d,d":["姑表外甥女"],m:["老母"],"m,f":["阿公"],"m,f,f":["外太公"],"m,f,m":["外太婆"],"m,m":["阿婆"],"m,m,f":["外太外公"],"m,m,m":["外太外婆"],"m,ob":["舅父"],"m,lb":["舅仔"],"m,xb,w":["舅母"],"0,m,xb,d,s":["舅表姨甥"],"1,m,xb,d,s":["舅表外甥"],"0,m,xb,d,d":["舅表姨甥女"],"1,m,xb,d,d":["舅表外甥女"],"m,os":["姨妈"],"m,ls":["姨仔"],"m,xs,h":["姨丈"]},f(d,"0,m,xb,d,s",["姨姨甥"]),f(d,"1,m,xb,d,s",["姨外甥"]),f(d,"0,m,xb,d,d",["姨姨甥女"]),f(d,"1,m,xb,d,d",["姨外甥女"]),f(d,"ob",["大佬"]),f(d,"ob,w",["阿嫂"]),f(d,"lb",["细佬"]),f(d,"lb,w",["弟妇"]),f(d,"xb,s",["侄"]),f(d,"xb,d",["侄女"]),f(d,"os",["家姐"]),f(d,"os,h",["姐夫"]),f(d,"ls",["阿妹"]),f(d,"ls,h",["妹夫"]),f(d,"0,xs,s",["姨甥"]),f(d,"1,xs,s",["外甥"]),f(d,"0,xs,d",["姨甥女"]),f(d,"1,xs,d",["外甥女"]),f(d,"s",["仔"]),f(d,"s,w",["新妇"]),f(d,"s,s",["孙"]),f(d,"s,s,w",["孙新妇"]),f(d,"s,s,s",["息仔"]),f(d,"s,s,d",["息女"]),f(d,"s,d",["孙女"]),f(d,"s,d,h",["孙女婿"]),f(d,"s,d,s",["外息仔"]),f(d,"s,d,d",["外息女"]),f(d,"d",["女"]),f(d,"d,s",["外孙"]),f(d,"d,s,w",["外孙新妇"]),f(d,"d,s,s",["外息仔"]),f(d,"d,s,d",["外息女"]),f(d,"d,d",["外孙女"]),f(d,"d,d,h",["外孙女婿"]),f(d,"d,d,s",["外息仔"]),f(d,"d,d,d",["外息女"]),d)},north:{name:"北方",data:{"m,m":["姥姥"],"m,m,xs":["姨姥姥"],"m,m,xs,h":["姨姥爷"],"m,m,xb":["舅姥爷"],"m,m,xb,w":["舅姥姥"],"m,f":["姥爷"],"m,f,xs":["姑姥姥"],"m,f,xs,h":["姑姥爷"],"m,f,ob":["大姥爷"],"m,f,ob,w":["大姥姥"],"m,f,lb":["小姥爷"],"m,f,lb,w":["小姥姥"],"f,ob":["大爷"],"f,ob,w":["大娘"]}}};export{o as default};
|
4
dist/relationship.min.js
vendored
4
dist/relationship.min.js
vendored
File diff suppressed because one or more lines are too long
13
dist/relationship.min.mjs
vendored
Normal file
13
dist/relationship.min.mjs
vendored
Normal file
File diff suppressed because one or more lines are too long
69
gulpfile.js
69
gulpfile.js
@ -1,69 +1,6 @@
|
||||
const gulp = require('gulp');
|
||||
const rename = require("gulp-rename");
|
||||
const cht = require('gulp-cht');
|
||||
const rollup = require('rollup');
|
||||
const terser = require('@rollup/plugin-terser');
|
||||
const resolve = require('@rollup/plugin-node-resolve');
|
||||
const babel = require('@rollup/plugin-babel');
|
||||
const pkg = require('./package');
|
||||
|
||||
// copyright
|
||||
let repository = pkg.repository.url.replace(/(.+)(:\/\/.+)\.git$/,'https$2');
|
||||
let now = new Date();
|
||||
let date = (new Date(now.getTime()-now.getTimezoneOffset()*60000)).toISOString().substr(0,10);
|
||||
let banner = `/*!
|
||||
* ${pkg.name} v${pkg.version}
|
||||
* ${pkg.description}
|
||||
* ${pkg.homepage}
|
||||
*
|
||||
* Copyright (c) 2016-present, ${pkg.author}
|
||||
*
|
||||
* Released under the ${pkg.license} License
|
||||
* ${repository}
|
||||
*
|
||||
* Created on: ${date}
|
||||
*/`;
|
||||
|
||||
gulp.task('build', () => {
|
||||
return rollup.rollup({
|
||||
input: './src/relationship.js',
|
||||
plugins: [
|
||||
terser(),
|
||||
resolve(),
|
||||
babel({
|
||||
babelHelpers: 'runtime',
|
||||
exclude:'node_modules/**'
|
||||
})
|
||||
]
|
||||
}).then(bundle => {
|
||||
return bundle.write({
|
||||
file: './dist/relationship.min.js',
|
||||
format: 'umd',
|
||||
name: 'relationship',
|
||||
banner
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
gulp.task('mode', () => {
|
||||
return rollup.rollup({
|
||||
input: './src/relationship-mode.js',
|
||||
plugins: [
|
||||
terser(),
|
||||
resolve(),
|
||||
babel({
|
||||
babelHelpers: 'runtime',
|
||||
exclude:'node_modules/**'
|
||||
})
|
||||
]
|
||||
}).then(bundle => {
|
||||
return bundle.write({
|
||||
file: './dist/relationship-mode.min.js',
|
||||
format: 'umd',
|
||||
name: 'relationshipMode',
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
gulp.task('localization', () => {
|
||||
// gulp.src('./index.html')
|
||||
@ -73,12 +10,14 @@ gulp.task('localization', () => {
|
||||
|
||||
return gulp.src([
|
||||
'dist/relationship.min.js',
|
||||
'dist/relationship.min.mjs',
|
||||
'dist/relationship-mode.min.js',
|
||||
'dist/relationship-mode.min.mjs',
|
||||
]).pipe(cht())
|
||||
.pipe(rename(function(path) {
|
||||
path.basename = path.basename.replace('.min','.zh-HK.min');
|
||||
}))
|
||||
.pipe(gulp.dest('dist/'))
|
||||
.pipe(gulp.dest('dist/lang/'))
|
||||
});
|
||||
|
||||
gulp.task('default', gulp.series(['build', 'mode', 'localization']))
|
||||
gulp.task('default', gulp.series(['localization']))
|
3363
package-lock.json
generated
3363
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
23
package.json
23
package.json
@ -2,7 +2,6 @@
|
||||
"name": "relationship.js",
|
||||
"version": "1.2.3",
|
||||
"description": "Chinese kinship library",
|
||||
"homepage": "https://passer-by.com/relationship/",
|
||||
"author": "HaoLe Zheng",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
@ -14,7 +13,12 @@
|
||||
"家庭亲戚称谓",
|
||||
"亲戚关系算法"
|
||||
],
|
||||
"main": "dist/relationship.min.js",
|
||||
"main": "./dist/relationship.min.js",
|
||||
"module": "./dist/relationship.min.mjs",
|
||||
"exports": {
|
||||
"default": "./dist/relationship.min.js",
|
||||
"import": "./dist/relationship.min.mjs"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/mumuy/relationship.git"
|
||||
@ -24,23 +28,28 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.22.9",
|
||||
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
||||
"@babel/plugin-syntax-import-attributes": "^7.22.5",
|
||||
"@babel/plugin-transform-class-properties": "^7.22.5",
|
||||
"@babel/plugin-transform-runtime": "^7.22.9",
|
||||
"@babel/preset-env": "^7.22.9",
|
||||
"@babel/runtime": "^7.22.6",
|
||||
"@rollup/plugin-babel": "^6.0.3",
|
||||
"@rollup/plugin-node-resolve": "^15.1.0",
|
||||
"@rollup/plugin-terser": "^0.4.1",
|
||||
"acorn-import-assertions": "^1.9.0",
|
||||
"rollup": "^3.26.3",
|
||||
"rollup-plugin-import-assert": "^3.0.1",
|
||||
"tape": "^5.6.3",
|
||||
"gulp": "^4.0.2",
|
||||
"gulp-cht": "^2.0.20",
|
||||
"gulp-rename": "^2.0.0",
|
||||
"rollup": "^3.20.2",
|
||||
"tape": "^5.3.1"
|
||||
"gulp-rename": "^2.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node test/index.js",
|
||||
"build": "gulp && npm run test"
|
||||
"build": "rollup -c && gulp && npm run test",
|
||||
"watch": "rollup -wc"
|
||||
},
|
||||
"homepage": "https://passer-by.com/relationship/",
|
||||
"directories": {
|
||||
"test": "test"
|
||||
}
|
||||
|
69
rollup.config.mjs
Normal file
69
rollup.config.mjs
Normal file
@ -0,0 +1,69 @@
|
||||
import resolve from '@rollup/plugin-node-resolve'; // 使用node_modules包
|
||||
import terser from '@rollup/plugin-terser'; // 代码压缩
|
||||
import babel from '@rollup/plugin-babel'; // ECMAScript兼容
|
||||
import {importAssertionsPlugin} from 'rollup-plugin-import-assert';
|
||||
import {importAssertions} from 'acorn-import-assertions';
|
||||
import pkg from './package.json' assert { type:'json' }; // 获取package信息
|
||||
|
||||
// 版权信息
|
||||
const repository = pkg.repository.url.replace(/(.+)(:\/\/.+)\.git$/,'https$2');
|
||||
const now = new Date();
|
||||
const date = (new Date(now.getTime()-now.getTimezoneOffset()*60000)).toISOString().substr(0,10);
|
||||
const banner = `/*!
|
||||
* ${pkg.name} v${pkg.version}
|
||||
* ${pkg.description}
|
||||
* ${pkg.homepage}
|
||||
*
|
||||
* Copyright (c) 2016-present, ${pkg.author}
|
||||
*
|
||||
* Released under the ${pkg.license} License
|
||||
* ${repository}
|
||||
*
|
||||
* Created on: ${date}
|
||||
*/`;
|
||||
|
||||
const commonPlugins = [
|
||||
resolve(),
|
||||
importAssertionsPlugin(),
|
||||
terser(),
|
||||
babel({
|
||||
babelHelpers: 'runtime',
|
||||
exclude:'node_modules/**'
|
||||
})
|
||||
];
|
||||
|
||||
export default [{
|
||||
input: './src/relationship.js',
|
||||
output:[{
|
||||
file: pkg.main,
|
||||
format: 'umd',
|
||||
name: 'relationship',
|
||||
banner
|
||||
},{
|
||||
file: pkg.module,
|
||||
format: 'es',
|
||||
banner
|
||||
}],
|
||||
acornInjectPlugins: [ importAssertions ],
|
||||
plugins: commonPlugins,
|
||||
watch: {
|
||||
exclude: 'node_modules/**'
|
||||
}
|
||||
},{
|
||||
input: './src/relationship-mode.js',
|
||||
output:[{
|
||||
file: './dist/relationship-mode.min.js',
|
||||
format: 'umd',
|
||||
name: 'relationshipMode',
|
||||
banner
|
||||
},{
|
||||
file: './dist/relationship-mode.min.mjs',
|
||||
format: 'es',
|
||||
banner
|
||||
}],
|
||||
acornInjectPlugins: [ importAssertions ],
|
||||
plugins: commonPlugins,
|
||||
watch: {
|
||||
exclude: 'node_modules/**'
|
||||
}
|
||||
}];
|
@ -383,7 +383,7 @@
|
||||
<a class="github-button" href="https://github.com/mumuy/relationship/archive/HEAD.zip" data-icon="octicon-download" data-size="large" aria-label="Download mumuy/relationship on GitHub">Download</a>
|
||||
</div>
|
||||
<p>爲了及時獲取最新最全的親戚關系數據,建議你直接引用本項目腳本文件:</p>
|
||||
<code><script type="text/javascript" src="https://passer-by.com/relationship/dist/relationship.zh-HK.min.js"></script></code>
|
||||
<code><script type="text/javascript" src="https://passer-by.com/relationship/dist/lang/relationship.zh-HK.min.js"></script></code>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -433,8 +433,8 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="dist/relationship.zh-HK.min.js"></script>
|
||||
<script type="text/javascript" src="dist/relationship-mode.zh-HK.min.js"></script>
|
||||
<script type="text/javascript" src="dist/lang/relationship.zh-HK.min.js"></script>
|
||||
<script type="text/javascript" src="dist/lang/relationship-mode.zh-HK.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
// 獲取數量
|
||||
document.getElementById('count').innerText = relationship.dataCount;
|
||||
|
Loading…
x
Reference in New Issue
Block a user