Skip to content

Commit

Permalink
Updated React, Babel, Webpack dependencies. Updated Webpack configura…
Browse files Browse the repository at this point in the history
…tion files.
  • Loading branch information
asabhaney committed Apr 4, 2018
1 parent 0213d1d commit 8b9a68c
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 67 deletions.
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"presets": ["es2015", "stage-0", "react"]
"presets": ["@babel/env", "@babel/stage-0", "@babel/react"]
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.DS_Store
node_modules
npm-debug.log
.tmp/*
.uploads/*
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

31 changes: 16 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"name": "react-files",
"version": "2.4.4",
"version": "3.0.0",
"main": "dist/index.js",
"description": "A file input (dropzone) management component for React",
"scripts": {
"build": "rm -rf dist && webpack",
"dev": "node server.js",
"demo": "node server.js",
"test": "mocha --compilers js:babel-core/register --recursive test/test.js",
"test:watch": "mocha --compilers js:babel-core/register --recursive test/test.js --watch --reporter min"
"test:watch": "mocha --compilers js:babel-core/register --recursive test/test.js --watch --reporter min",
"webpack-analyze": "mkdir -p .tmp; NODE_ENV=production webpack --config webpack.config.js --profile --json > .tmp/stats.json; webpack-bundle-analyzer .tmp/stats.json"
},
"files": [
"dist/index.js"
Expand All @@ -34,12 +35,12 @@
"homepage": "https://github.com/mother/react-files",
"devDependencies": {
"axios": "0.16.2",
"babel-core": "6.21.0",
"@babel/core": "7.0.0-beta.43",
"@babel/preset-env": "7.0.0-beta.43",
"@babel/preset-react": "7.0.0-beta.43",
"@babel/preset-stage-0": "7.0.0-beta.43",
"babel-eslint": "7.1.1",
"babel-loader": "6.2.10",
"babel-preset-es2015": "6.18.0",
"babel-preset-react": "6.16.0",
"babel-preset-stage-0": "6.16.0",
"babel-loader": "8.0.0-beta.2",
"blob": "0.0.4",
"chai": "3.5.0",
"enzyme": "2.4.1",
Expand All @@ -54,14 +55,14 @@
"jsdom": "9.4.2",
"mocha": "3.0.2",
"multer": "1.3.0",
"prop-types": "15.5.10",
"react": "15.6.1",
"prop-types": "15.6.1",
"react": "16.2.0",
"react-addons-test-utils": "15.3.1",
"react-dom": "15.6.1",
"react-hot-loader": "1.3.1",
"sinon": "1.17.5",
"webpack": "1.12.2",
"webpack-dev-middleware": "1.12.0",
"webpack-hot-middleware": "2.18.2"
"react-dom": "16.2.0",
"webpack": "4.4.1",
"webpack-bundle-analyzer": "2.11.1",
"webpack-cli": "2.0.13",
"webpack-dev-middleware": "3.1.0",
"webpack-hot-middleware": "2.21.2"
}
}
1 change: 0 additions & 1 deletion test/test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react'
import { mount } from 'enzyme'
// import sinon from 'sinon'
import { expect } from 'chai'
import { describe, it } from 'mocha'

Expand Down
48 changes: 21 additions & 27 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,25 @@
const path = require('path')
const webpack = require('webpack')

module.exports = {
entry: './src/index.js',
output: {
path: path.join(__dirname, 'dist'),
filename: 'index.js',
libraryTarget: 'umd',
publicPath: '/static/'
},
plugins: [
new webpack.optimize.UglifyJsPlugin({
compress: { warnings: false }
})
],
externals: {
'react': 'react'
},
module: {
loaders: [{
test: /\.js$/,
loaders: ['babel'],
include: path.join(__dirname, 'src')
}],
resolve: {
// Can require('file') instead of require('file.js') etc.
extensions: ['', '.js', '.json']
}
}
mode: 'production',
entry: {
main: './src/index.js'
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'index.js',
libraryTarget: 'umd'
},
externals: {
react: 'react'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: ['babel-loader']
}
]
}
}
50 changes: 28 additions & 22 deletions webpack.dev.config.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
var path = require('path')
var webpack = require('webpack')
const path = require('path')
const webpack = require('webpack')

module.exports = {
devtool: 'eval',
entry: [
'webpack-hot-middleware/client?path=/__webpack_hmr&timeout=20000',
'./src/demo'
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/static/'
},
plugins: [
new webpack.HotModuleReplacementPlugin()
],
module: {
loaders: [{
test: /\.js$/,
loaders: ['react-hot', 'babel'],
include: path.join(__dirname, 'src')
}]
}
mode: 'development',
entry: [
'webpack-hot-middleware/client?path=/__webpack_hmr&timeout=20000',
'./src/demo.js'
],
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/static/'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: ['babel-loader']
}
]
},
plugins: [
new webpack.HotModuleReplacementPlugin()
],
resolve: {
extensions: ['.js'],
enforceExtension: false
}
}

0 comments on commit 8b9a68c

Please sign in to comment.