Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-file-drop

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-file-drop - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

dist/Demo/Demo-594991.bundle.js

14

package.json
{
"name": "react-file-drop",
"author": "https://sarink.net",
"version": "0.2.0",
"version": "0.2.1",
"description": "React component for Gmail or Facbook -like drag and drop file uploader. Drag files anywhere onto the window to highlight a 'drop area' of the page",
"main": "dist/FileDrop.bundle.js",
"main": "src/FileDrop/FileDrop",
"scripts": {
"start:dev": "webpack-dev-server",
"build:prod": "NODE_ENV=production webpack -p",
"lint": "tslint --project .",
"build:filedrop": "tsc --project src/FileDrop",
"build:demo": "NODE_ENV=production webpack -p",
"lint": "tslint --project src",
"lint:watch": "SHELL=/bin/bash chokidar webpack.config.* tslint.json tsconfig.json ./**/*.ts ./**/*.tsx -c \"npm run lint\" --initial --verbose",

@@ -55,7 +56,4 @@ "lint:fix": "tslint --project . --fix"

"@types/react-dom": "^16.0.3",
"@types/react-hot-loader": "^3.0.6",
"@types/webpack": "^3.8.1",
"@types/webpack-dev-server": "^2.9.2",
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"chokidar": "^1.7.0",

@@ -65,7 +63,5 @@ "chokidar-cli": "^1.2.0",

"css-loader": "^0.28.7",
"extract-text-webpack-plugin": "^3.0.2",
"html-webpack-plugin": "^3.2.0",
"react": "^16.3.1",
"react-dom": "^16.3.1",
"react-hot-loader": "^4.0.1",
"source-map-loader": "^0.2.3",

@@ -72,0 +68,0 @@ "style-loader": "^0.19.0",

@@ -7,3 +7,3 @@ # react-file-drop

## Demo/Example
http://sarink.github.io/react-file-drop/dist/demo.html - A very simple demo with example code and sample CSS
http://sarink.github.io/react-file-drop/dist/Demo - A very simple demo with example code and sample CSS

@@ -49,8 +49,4 @@ ## By default, there are no styles! You must include some CSS if you want to see anything!

##### dropEffect - String "copy" || "move" || "link" || "none" (default: "copy")
Learn more about [HTML5 dropEffects](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer#dropEffect.28.29) <br/>
Not available in IE :(
Learn more about [HTML5 dropEffects](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer#dropEffect.28.29). Not available in IE :(
##### targetAlwaysVisible - Boolean (default: false)
If you'd like the ``file-drop-target`` div to always be visible (otherwise, it's only visible when the user begins dragging over the ``frame``)
##### frame - document || HTMLElement (default: document)

@@ -57,0 +53,0 @@ This is the "scope" or frame that the user must drag some file(s) over to kick things off.

@@ -7,3 +7,2 @@ /* eslint-disable import/no-commonjs */

const HtmlWebpackPlugin = require('html-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const webpack = require('webpack');

@@ -14,43 +13,9 @@

const distDirName = 'dist';
const distDirName = path.join('dist', 'Demo');
const demoDirName = path.join('src', 'Demo');
const sharedPlugins = [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development'),
}),
new HtmlWebpackPlugin({
filename: 'demo.html',
chunks: ['demo'],
template: './demo.html',
inject: true,
}),
new CleanWebpackPlugin(path.resolve(__dirname, distDirName)),
];
const prodPlugins = [
...sharedPlugins,
new ExtractTextPlugin('[name]-[hash:6].bundle.css'),
];
const devPlugins = [
...sharedPlugins,
new webpack.HotModuleReplacementPlugin(),
new webpack.NamedModulesPlugin(),
];
const prodEntry = { demo: ['demo.tsx'], FileDrop: ['FileDrop.tsx'] };
const devEntry = { ...prodEntry };
const rhlBabelLoader = {
loader: 'babel-loader',
options: {
plugins: ['react-hot-loader/babel'],
},
};
const tsLoader = 'ts-loader';
const cssLoader = 'css-loader';
const styleLoader = 'style-loader';
module.exports = {
context: path.resolve(__dirname),
entry: isProd ? prodEntry : devEntry,
entry: { Demo: [path.join(demoDirName, 'Demo.tsx')] },

@@ -60,3 +25,3 @@ output: {

path: path.resolve(__dirname, distDirName), // Local disk directory to store all your output files (Absolute path)
filename: '[name].bundle.js',
filename: '[name]-[hash:6].bundle.js',
},

@@ -69,8 +34,8 @@

exclude: [path.resolve(__dirname, 'node_modules')],
use: isProd ? [tsLoader] : [rhlBabelLoader, tsLoader],
use: 'ts-loader',
},
{
test: /\.css$/,
include: [path.resolve(__dirname, '')],
use: isProd ? ExtractTextPlugin.extract({ use: [cssLoader], fallback: styleLoader }) : [styleLoader, cssLoader],
include: [path.resolve(__dirname, demoDirName)],
use: ['style-loader', 'css-loader'],
},

@@ -88,2 +53,12 @@ ],

plugins: [
isProd ? new CleanWebpackPlugin(path.resolve(__dirname, distDirName)) : new webpack.HotModuleReplacementPlugin(),
new webpack.NamedModulesPlugin(),
new HtmlWebpackPlugin({
filename: 'index.html',
template: path.join(demoDirName, 'index.html'),
inject: true,
}),
],
devServer: {

@@ -93,3 +68,3 @@ publicPath: '/', // URL path where the webpack files are served from

host: '0.0.0.0',
port: process.env.PORT, // set in docker-compose.yml
port: process.env.PORT, // Set in docker-compose.yml
disableHostCheck: true,

@@ -105,5 +80,3 @@ hot: true,

},
plugins: isProd ? prodPlugins : devPlugins,
};
/* eslint-enable import/no-commonjs */
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc