Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ES6 module distribution build and typescript typing information. #491

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions dist/vue2Dropzone.esm.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/vue2Dropzone.esm.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/vue2Dropzone.js.map

Large diffs are not rendered by default.

48 changes: 48 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import Vue, { Component } from 'vue'

export default class VueDropZone extends Vue {

}



export interface DropZoneOptions {
url?: string | null;
method?: string;
withCredentials?: boolean;
timeout?: number;
parallelUploads?: number;
uploadMultiple?: boolean;
chunking?: boolean;
forceChunking?: boolean;
chunkSize?: number;
parallelChunkUploads?: boolean;
retryChunks?: boolean;
retryChunksLimit?: number;
maxFilesize?: number | null;
paramName?: string;
createImageThumbnails?: boolean;
maxThumbnailFilesize?: number;
thumbnailWidth?: number;
thumbnailHeight?: number;
thumbnailMethod?: string;
resizeWidth?: number | null;
resizeHeight?: number | null;
resizeMimeType?: string | null;
resizeQuality?: number;
resizeMethod?: string;
filesizeBase?: number;
maxFiles?: number | null;
headers?: null | {[h: string]: string};
clickable?: boolean | string | HTMLElement;
ignoreHiddenFiles?: boolean;
acceptedFiles?: null | string;
autoProcessQueue?: boolean;
autoQueue?: boolean;
addRemoveLinks?: boolean;
previewsContainer?: null | string | HTMLElement;
hiddenInputContainer?: null | string | HTMLElement;
capture?: null | 'camera' | 'microphone' | 'camcorder';
renameFile?: null | ((f: File) => void);
forceFallback?: boolean;
}
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"version": "3.6.0",
"license": "MIT",
"main": "./dist/vue2Dropzone.js",
"module": "./dist/vue2Dropzone.esm.js",
"repository": "[email protected]:rowanwins/vue-dropzone.git",
"devDependencies": {
"@babel/core": "^7.3.4",
Expand Down Expand Up @@ -46,7 +47,9 @@
"webpack-dev-server": "^3.2.1"
},
"scripts": {
"build": "cross-env NODE_ENV=production rollup -c",
"build": "npm run build-umd; npm run build-esm",
"build-umd": "cross-env NODE_ENV=production output=umd rollup -c",
"build-esm": "cross-env NODE_ENV=production output=esm rollup -c",
"build-docs": "npm run clean-docs && cross-env NODE_ENV=production webpack --mode production --progress --hide-modules",
"clean-docs": "rimraf docs/dist",
"dev": "rollup -c -w",
Expand All @@ -59,4 +62,4 @@
"dependencies": {
"dropzone": "^5.5.1"
}
}
}
16 changes: 14 additions & 2 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,25 @@ import replace from 'rollup-plugin-replace';
import { terser } from "rollup-plugin-terser";
import css from 'rollup-plugin-css-only'


let format = 'umd';
let output = 'dist/vue2Dropzone.js';
if (process.env.output == 'esm') {
format = 'esm';
output = 'dist/vue2Dropzone.esm.js'
}
else {
// default to umd
}


export default {
input: 'src/index.js',
output: {
file: 'dist/vue2Dropzone.js',
file: output,
name: 'vue2Dropzone',
sourcemap: true,
format: 'umd',
format: format,
},
plugins: [
resolve({
Expand Down