Skip to content

Commit

Permalink
clean up builds
Browse files Browse the repository at this point in the history
  • Loading branch information
pstadler committed Feb 19, 2018
1 parent 8a60087 commit 4795153
Show file tree
Hide file tree
Showing 12 changed files with 205 additions and 175 deletions.
2 changes: 1 addition & 1 deletion example/lib/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<title>UPP Admin</title>
<title>Datatrans React Lightbox</title>
</head>


Expand Down
158 changes: 102 additions & 56 deletions example/lib/main.js

Large diffs are not rendered by default.

7 changes: 1 addition & 6 deletions example/src/App.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@

import React, {PropTypes, Component} from 'react'
import React, { Component } from 'react'
import LightBox from 'react-datatrans-light-box'


const config = {
merchantId: '1100004624',
refno: '11000asdfasdf4624',
Expand Down Expand Up @@ -97,11 +95,8 @@ class LightBoxHocApproachBase extends Component {

}


LightBoxHocApproachBase.propTypes = {
lightBox: LightBox.Hoc.propType,

}

const LightBoxHocApproach = LightBox.Hoc(LightBoxHocApproachBase)

2 changes: 1 addition & 1 deletion example/src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<title>UPP Admin</title>
<title>Datatrans React Lightbox</title>
</head>


Expand Down
29 changes: 7 additions & 22 deletions example/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,21 @@
const path = require('path')
const webpack = require('webpack')

const HtmlWebpackPlugin = require('html-webpack-plugin')

module.exports = {
module: {
loaders: [{
test: /\.js$/, // Transform all .js files required somewhere with Babel
loader: 'babel-loader',
// include: ['../../shared'],
// exclude: [/node_modules/],
// query: env.babelQuery,
}]
loaders: [
{
test: /\.js$/,
loader: 'babel-loader'
}
]

},
entry: {
main: ['./src/index.js'],

},
plugins: [
// new webpack.optimize.UglifyJsPlugin({
// compress: {
// warnings: false, // ...but do not show warnings in the console (there is a lot of them)
// },
// comments: false,
// }),
// new webpack.HotModuleReplacementPlugin(), // Tell webpack we want hot reloading
// new webpack.NoErrorsPlugin(),
new HtmlWebpackPlugin({
inject: true,
chunks:['app'],
Expand All @@ -38,9 +27,5 @@ module.exports = {
output: {
path: path.resolve(__dirname, 'lib'),
filename: '[name].js'
},

// resolve: {
// modules:[path.resolve(__dirname, '../../shared'), 'node_modules']
// }
}
}
4 changes: 1 addition & 3 deletions example/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2400,9 +2400,7 @@ rc@^1.1.7:
strip-json-comments "~2.0.1"

react-datatrans-light-box@../:
version "1.0.2"
dependencies:
prop-types "^15.6.0"
version "1.0.4"

react-dom@^16.2.0:
version "16.2.0"
Expand Down
2 changes: 1 addition & 1 deletion lib/main.js

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,14 @@
"babel-preset-latest": "^6.24.0",
"babel-preset-react": "^6.23.0",
"babel-preset-stage-0": "^6.22.0",
"compression-webpack-plugin": "^0.3.2",
"eslint": "^3.11.1",
"eslint-import-resolver-webpack": "^0.8.0",
"eslint-loader": "^1.5.0",
"eslint-plugin-flowtype": "^2.29.1",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-jsx-a11y": "^3.0.1",
"eslint-plugin-react": "^6.8.0",
"prop-types": "^15.6.0",
"webpack": "^2.3.2"
},
"dependencies": {}
}
}
28 changes: 13 additions & 15 deletions src/LightBoxHoc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, {Component} from 'react'
// import PropTypes from 'prop-types'
import PropTypes from 'prop-types'
import LightBox from './LightBox'
import {filterProps} from './utils'

Expand Down Expand Up @@ -105,19 +105,17 @@ const LightBoxHoc = Wrapee => class Wrapper extends Component {
}
}

// LightBoxHoc.propType = PropTypes.shape({


// //LightBox state
// visible: PropTypes.bool.isRequired,
// loaded: PropTypes.bool.isRequired,
// cancelled: PropTypes.bool.isRequired,
// error: PropTypes.any,

// //Methods
// load: PropTypes.func.isRequired,
// show: PropTypes.func.isRequired,
// on: PropTypes.func.isRequired,
// })
LightBoxHoc.propType = PropTypes.shape({
//LightBox state
visible: PropTypes.bool.isRequired,
loaded: PropTypes.bool.isRequired,
cancelled: PropTypes.bool.isRequired,
error: PropTypes.any,

//Methods
load: PropTypes.func.isRequired,
show: PropTypes.func.isRequired,
on: PropTypes.func.isRequired,
})

export default LightBoxHoc
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import LightBox from './LightBox.js'
import LightBox from './LightBox'
import LightBoxHoc from './LightBoxHoc'

LightBox.Hoc = LightBoxHoc
Expand Down
18 changes: 0 additions & 18 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const path = require('path')
const webpack = require('webpack')
const CompressionPlugin = require('compression-webpack-plugin')

module.exports = {
externals: {
Expand All @@ -9,14 +8,6 @@ module.exports = {
commonjs2: 'react',
commonjs: 'react',
amd: 'react'
},
'prop-types': {
react: {
root: 'PropTypes',
commonjs2: 'prop-types',
commonjs: 'prop-types',
amd: 'prop-types'
}
}
},
module: {
Expand All @@ -31,14 +22,12 @@ module.exports = {
},
entry: {
main: ['./src/index.js'],

},
plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production')
}),
new webpack.optimize.UglifyJsPlugin({

beautify: false,
mangle: true,
output: {
Expand All @@ -57,13 +46,6 @@ module.exports = {
booleans: true,
},
comments: false,
}),
new CompressionPlugin({
asset: '[path].gz[query]',
algorithm: 'gzip',
test: /\.js$|\.css$|\.html$/,
threshold: 10240,
minRatio: 0
})
],

Expand Down
Loading

0 comments on commit 4795153

Please sign in to comment.