Skip to content

Commit

Permalink
Merge pull request #50 from tbolis/bug/issue#49/react-hot-loader-bundled
Browse files Browse the repository at this point in the history
Properly set NODE_ENV
  • Loading branch information
tbolis authored Dec 13, 2018
2 parents db44660 + 6f58f73 commit 3dff7d7
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 28 deletions.
5 changes: 1 addition & 4 deletions examples/main.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
/*eslint no-unused-vars: 0*/
/*eslint no-console: 0*/

'use strict';
/*eslint no-unused-vars: 0, no-console: 0*/

import React from 'react';
import {CompactPicker} from 'react-color';
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-sketch",
"version": "0.5.0",
"version": "0.5.1",
"description": "Sketch Element for React based applications, backed-up by fabricjs as its core",
"keywords": [
"react",
Expand All @@ -23,9 +23,9 @@
"license": "MIT",
"main": "./dist",
"scripts": {
"build": "webpack --mode production --config webpack/library.cfg.js --display-modules",
"build": "cross-env NODE_ENV=production webpack --mode production --config webpack/library.cfg.js --display-modules",
"build:light": "babel ./src --out-dir ./dist",
"build:examples": "webpack --mode production --config webpack/examples.cfg.js",
"build:examples": "cross-env NODE_ENV=production webpack --mode production --config webpack/examples.cfg.js",
"clean": "rimraf dist build",
"lint": "eslint ./src",
"lint:fix": "eslint --fix ./src",
Expand Down Expand Up @@ -92,6 +92,7 @@
"babel-loader": "8.0.4",
"babel-plugin-lodash": "3.3.4",
"canvas": "^1.6.12",
"cross-env": "^5.2.0",
"css-loader": "^1.0.1",
"enzyme": "3.7.0",
"enzyme-adapter-react-16": "1.7.0",
Expand Down
1 change: 0 additions & 1 deletion src/circle.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/*eslint no-unused-vars: 0*/
'use strict';

import FabricCanvasTool from './fabrictool'
import {linearDistance} from './utils';
Expand Down
1 change: 0 additions & 1 deletion src/fabrictool.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint no-unused-vars: 0 */
'use strict';

/**
* "Abstract" like base class for a Canvas tool
Expand Down
2 changes: 0 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

import SketchField from './SketchField'
import Tools from './tools'

Expand Down
1 change: 0 additions & 1 deletion src/line.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/*eslint no-unused-vars: 0*/
'use strict';

import FabricCanvasTool from './fabrictool'

Expand Down
1 change: 0 additions & 1 deletion src/pan.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/*eslint no-unused-vars: 0*/
'use strict';

import FabricCanvasTool from './fabrictool'

Expand Down
1 change: 0 additions & 1 deletion src/pencil.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use strict';

import FabricCanvasTool from './fabrictool'

Expand Down
1 change: 0 additions & 1 deletion src/rectangle.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/*eslint no-unused-vars: 0*/
'use strict';

import FabricCanvasTool from './fabrictool'

Expand Down
1 change: 0 additions & 1 deletion src/select.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/*eslint no-unused-vars: 0*/
'use strict';

import FabricCanvasTool from './fabrictool'

Expand Down
2 changes: 0 additions & 2 deletions src/tools.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

export default {
Circle: 'circle',
Line: 'line',
Expand Down
8 changes: 0 additions & 8 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,6 @@ export const pointerPosition = (event) => {
return [(_x || _touchX), (_y || _touchY)];
};

//function getMouseCoords(canvas, event)
//{
// var pointer = canvas.getPointer(event.e);
// var posX = pointer.x;
// var posY = pointer.y;
// console.log(posX+", "+posY); // Log to console
//}

/**
* Calculate the distance of two x,y points
*
Expand Down
7 changes: 6 additions & 1 deletion webpack/library.cfg.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const NoEmitOnErrorsPlugin = require('webpack/lib/NoEmitOnErrorsPlugin');
const OccurrenceOrderPlugin = require('webpack/lib/optimize/OccurrenceOrderPlugin');
const AggressiveMergingPlugin = require('webpack/lib/optimize/AggressiveMergingPlugin');
const ModuleConcatenationPlugin = require('webpack/lib/optimize/ModuleConcatenationPlugin');

function containsObject(obj, list) {
var i;
Expand Down Expand Up @@ -52,6 +53,7 @@ module.exports = {
]
},
plugins: [
new ModuleConcatenationPlugin(),
new UglifyJsPlugin({
parallel: true,
uglifyOptions: {
Expand All @@ -60,6 +62,9 @@ module.exports = {
}),
new NoEmitOnErrorsPlugin(),
new OccurrenceOrderPlugin(),
new AggressiveMergingPlugin()
new AggressiveMergingPlugin(),
new DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production')
})
]
};
10 changes: 9 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2478,6 +2478,14 @@ create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4:
safe-buffer "^5.0.1"
sha.js "^2.4.8"

cross-env@^5.2.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-5.2.0.tgz#6ecd4c015d5773e614039ee529076669b9d126f2"
integrity sha512-jtdNFfFW1hB7sMhr/H6rW1Z45LFqyI431m3qU6bFXcQ3Eh7LtBuG3h74o7ohHZ3crrRkkqHlo4jYHFPcjroANg==
dependencies:
cross-spawn "^6.0.5"
is-windows "^1.0.0"

cross-spawn@^5.0.1:
version "5.1.0"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449"
Expand Down Expand Up @@ -4892,7 +4900,7 @@ is-utf8@^0.2.0:
resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72"
integrity sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=

is-windows@^1.0.2:
is-windows@^1.0.0, is-windows@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d"
integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==
Expand Down

0 comments on commit 3dff7d7

Please sign in to comment.