Skip to content

Commit

Permalink
docs(examples): add dependency for babel-plugin-lodash
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Fedyashov committed May 29, 2017
1 parent 6bf47ab commit 67d761b
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 24 deletions.
25 changes: 14 additions & 11 deletions examples/webpack1/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,27 @@
"description": "Get started with Semantic UI React and Webpack 1",
"main": "index.js",
"scripts": {
"analize": "cross-env ANALIZE_ENV=true npm run build",
"analize:production": "cross-env ANALIZE_ENV=true npm run build:production",
"build": "webpack",
"build:production": "cross-env NODE_ENV=production npm run build"
},
"author": "Alexander Fedyashov <a@fedyashov.com>",
"license": "MIT",
"dependencies": {
"babel-core": "^6.24.0",
"babel-loader": "^6.4.0",
"babel-preset-es2015": "^6.24.0",
"babel-preset-react": "^6.23.0",
"babel-preset-stage-1": "^6.22.0",
"cross-env": "^3.2.3",
"react": "^15.4.2",
"react-dom": "^15.4.2",
"semantic-ui-react": "^0.68.3",
"webpack": "^1.12.14"
"babel-core": "^6.24.1",
"babel-loader": "^6.4.1",
"babel-plugin-lodash": "^3.2.11",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-1": "^6.24.1",
"cross-env": "^5.0.0",
"react": "^15.5.4",
"react-dom": "^15.5.4",
"semantic-ui-react": "^0.68.4",
"webpack": "^1.15.0"
},
"devDependencies": {
"webpack-bundle-analyzer": "^2.3.1"
"webpack-bundle-analyzer": "^2.8.2"
}
}
6 changes: 5 additions & 1 deletion examples/webpack1/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPl
const path = require('path')
const webpack = require('webpack')

const analize = !!process.env.ANALIZE_ENV
const env = process.env.NODE_ENV || 'development'

const webpackConfig = {
Expand All @@ -26,7 +27,6 @@ const webpackConfig = {
NODE_ENV: JSON.stringify(env),
},
}),
new BundleAnalyzerPlugin(),
],

output: {
Expand All @@ -41,6 +41,10 @@ const webpackConfig = {
},
}

if(analize) {
webpackConfig.plugins.push(new BundleAnalyzerPlugin())
}

if (env === 'production') {
webpackConfig.plugins.push(
new webpack.optimize.OccurrenceOrderPlugin(),
Expand Down
25 changes: 14 additions & 11 deletions examples/webpack2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,27 @@
"description": "Get started with Semantic UI React and Webpack 2",
"main": "index.js",
"scripts": {
"analize": "cross-env ANALIZE_ENV=true npm run build",
"analize:production": "cross-env ANALIZE_ENV=true npm run build:production",
"build": "webpack",
"build:production": "cross-env NODE_ENV=production npm run build"
},
"author": "Alexander Fedyashov <a@fedyashov.com>",
"license": "MIT",
"dependencies": {
"babel-core": "^6.24.0",
"babel-loader": "^6.4.0",
"babel-preset-es2015": "^6.24.0",
"babel-preset-react": "^6.23.0",
"babel-preset-stage-1": "^6.22.0",
"cross-env": "^3.2.3",
"react": "^15.4.2",
"react-dom": "^15.4.2",
"semantic-ui-react": "^0.68.3",
"webpack": "^2.3.0"
"babel-core": "^6.24.1",
"babel-loader": "^7.0.0",
"babel-plugin-lodash": "^3.2.11",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-1": "^6.24.1",
"cross-env": "^5.0.0",
"react": "^15.5.4",
"react-dom": "^15.5.4",
"semantic-ui-react": "^0.68.4",
"webpack": "^2.6.1"
},
"devDependencies": {
"webpack-bundle-analyzer": "^2.3.1"
"webpack-bundle-analyzer": "^2.8.2"
}
}
6 changes: 5 additions & 1 deletion examples/webpack2/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPl
const path = require('path')
const webpack = require('webpack')

const analize = !!process.env.ANALIZE_ENV
const env = process.env.NODE_ENV || 'development'

const webpackConfig = {
Expand All @@ -26,7 +27,6 @@ const webpackConfig = {
NODE_ENV: JSON.stringify(env),
},
}),
new BundleAnalyzerPlugin(),
],

output: {
Expand All @@ -44,6 +44,10 @@ const webpackConfig = {
},
}

if(analize) {
webpackConfig.plugins.push(new BundleAnalyzerPlugin())
}

if (env === 'production') {
webpackConfig.plugins.push(
new webpack.LoaderOptionsPlugin({
Expand Down

0 comments on commit 67d761b

Please sign in to comment.