From 16ea95a6ddccdffe4a724eb3d243808ebf640e07 Mon Sep 17 00:00:00 2001 From: fengruxian Date: Tue, 28 Dec 2021 17:03:56 +0800 Subject: [PATCH 1/2] (chore): npm publish --- .npmignore | 15 +++++++++++++++ README.md | 12 +++++++++--- package.json | 8 +++++--- 3 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 .npmignore diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..49601ad --- /dev/null +++ b/.npmignore @@ -0,0 +1,15 @@ +example/ +node_modules/ +test/ +debug/ +scripts/ +.gitignore +.eslintignore +.eslintrc.json +.stylelintignore +.stylelintrc.json +.npmignore +yarn.lock +*.log +.DS_Store +.cache \ No newline at end of file diff --git a/README.md b/README.md index b2f7fa2..df80eec 100644 --- a/README.md +++ b/README.md @@ -10,10 +10,12 @@ An image preview plugin for mobile web application. 4. 🍂 Based webgl. ### How to use it: -There are two ways: -#### 1. Copy release +There are three ways: +#### 1. npm install +`npm i @daxiazilong/image-preview` +#### 2. Copy release * The `release/image-preview` directory is built for different module-system , include AMD,CommonJS,ES6,UMD,IIFE. You can choose one adapt to your project. -#### 2.Install: +#### 3.Install: * Clone it ,then `npm i & npm run build` * For different module-sysetem: * The `release/image-preview` directory is built for different module-system , include AMD,CommonJS,ES6,UMD,IIFE. You can choose one adapt to your project. @@ -32,6 +34,10 @@ There are two ways: ```javascript import {ImagePreview} from 'js/image-preview-esm.js' ``` + or if installed in node_modules + ```javascript + import {ImagePreview} from '@daxiazilong/image-preview' + ``` #### usage: html: ```html diff --git a/package.json b/package.json index 5ca7c20..81b8994 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,9 @@ { - "name": "image-preview", - "version": "2.1.1", - "description": "image-preview", + "name": "@daxiazilong/image-preview", + "version": "2.1.2", + "description": "preview image on web page。rotate,zoom.etc. 移动端JS 图片预览 插件 支持 预览图片,旋转,放大(双指/双击)。", + "keywords": ["image preview", "viewer", "preview image"], + "main": "release/image-preview/image-preview-esm-min.js", "scripts": { "start": "webpack serve --open Chrome.exe --mode=development", "build": "node scripts/beforeBuild.js && npm run genModule", From d5d63fa866e5617df2bd533af87727512895e13e Mon Sep 17 00:00:00 2001 From: fengruxian Date: Wed, 29 Dec 2021 14:47:33 +0800 Subject: [PATCH 2/2] (chore): npm publish --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 81b8994..d1bec8b 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,10 @@ { "name": "@daxiazilong/image-preview", - "version": "2.1.2", + "version": "2.1.3", "description": "preview image on web page。rotate,zoom.etc. 移动端JS 图片预览 插件 支持 预览图片,旋转,放大(双指/双击)。", "keywords": ["image preview", "viewer", "preview image"], - "main": "release/image-preview/image-preview-esm-min.js", + "main": "release/image-preview/image-preview-cjs-min.js", + "module": "release/image-preview/image-preview-esm-min.js", "scripts": { "start": "webpack serve --open Chrome.exe --mode=development", "build": "node scripts/beforeBuild.js && npm run genModule",