Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Commit

Permalink
v2.2.0: welcome copy webpack plugin.
Browse files Browse the repository at this point in the history
  • Loading branch information
alansouzati committed Jan 31, 2017
1 parent 8392614 commit 19c465a
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 28 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "grommet-cli",
"version": "2.1.6",
"version": "2.2.0",
"main": "src/grommet.js",
"description": "Command line interface for Grommet.",
"authors": [
Expand Down
24 changes: 0 additions & 24 deletions src/commands/pack.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,29 +29,6 @@ function deleteDistributionFolder() {
});
}

function copyPublicFolder() {
return new Promise((resolve, reject) => {
console.log(
`${delimiter}: Copying public folder...`
);

const publicFolder = path.resolve('public');
fs.exists(publicFolder, (exists) => {
if (exists) {
fs.copy(
path.resolve('public'), path.resolve('dist'),
(err) => err ? reject(err) : resolve()
);
} else {
console.log(
`${delimiter}: ${chalk.yellow('warning')} Public folder does not exist...`
);
resolve();
}
});
});
}

function runDevServer(compiler) {
console.log(
`${delimiter}: Starting dev server...`
Expand Down Expand Up @@ -210,7 +187,6 @@ export default function (vorpal) {
const timeId = process.hrtime();

deleteDistributionFolder()
.then(copyPublicFolder)
.then(packProject)
.then(() => {
console.log(
Expand Down
3 changes: 2 additions & 1 deletion templates/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"babel-preset-react": "^6.16.0",
"babel-preset-react-hmre": "^1.1.1",
"babel-register": "^6.18.0",
"copy-webpack-plugin": "^4.0.1",
"cross-env": "^3.1.4",
"es6-promise": "^4.0.5",
"eslint": "^3.9.1",
Expand All @@ -50,7 +51,7 @@
"eslint-plugin-jsx-a11y": "^2.2.3",
"eslint-plugin-react": "^6.6.0",
"file-loader": "^0.9.0",
"grommet-cli": "^2.0.0",
"grommet-cli": "^2.2.0",
"node-sass": "^4.1.1",
"nodemon": "^1.11.0",
"pre-commit": "^1.2.2",
Expand Down
2 changes: 2 additions & 0 deletions templates/app/webpack.config.babel.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import path from 'path';
import webpack from 'webpack';
import CopyWebpackPlugin from 'copy-webpack-plugin';
import WatchMissingNodeModulesPlugin from
'react-dev-utils/WatchMissingNodeModulesPlugin';

const env = process.env.NODE_ENV || 'production';

let plugins = [
new CopyWebpackPlugin([{ from: './public' }]),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify(env)
Expand Down
3 changes: 2 additions & 1 deletion templates/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"babel-preset-es2015": "^6.18.0",
"babel-preset-react": "^6.16.0",
"babel-preset-react-hmre": "^1.1.1",
"copy-webpack-plugin": "^4.0.1",
"cross-env": "^3.1.4",
"eslint": "^3.9.1",
"eslint-config-airbnb": "^13.0.0",
Expand All @@ -32,7 +33,7 @@
"eslint-plugin-jsx-a11y": "^2.2.3",
"eslint-plugin-react": "^6.6.0",
"file-loader": "^0.9.0",
"grommet-cli": "^2.0.0",
"grommet-cli": "^2.2.0",
"node-sass": "^4.1.1",
"pre-commit": "^1.2.2",
"react-dev-utils": "^0.4.2",
Expand Down
2 changes: 2 additions & 0 deletions templates/basic/webpack.config.babel.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import path from 'path';
import webpack from 'webpack';
import CopyWebpackPlugin from 'copy-webpack-plugin';
import WatchMissingNodeModulesPlugin from
'react-dev-utils/WatchMissingNodeModulesPlugin';

const env = process.env.NODE_ENV || 'production';

let plugins = [
new CopyWebpackPlugin([{ from: './public' }]),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify(env)
Expand Down
3 changes: 2 additions & 1 deletion templates/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"babel-preset-react": "^6.16.0",
"babel-preset-react-hmre": "^1.1.1",
"babel-register": "^6.18.0",
"copy-webpack-plugin": "^4.0.1",
"cross-env": "^3.1.4",
"ejs-compiled-loader": "^2.1.1",
"eslint": "^3.9.1",
Expand All @@ -36,7 +37,7 @@
"eslint-plugin-jsx-a11y": "^2.2.3",
"eslint-plugin-react": "^6.6.0",
"file-loader": "^0.9.0",
"grommet-cli": "^2.0.0",
"grommet-cli": "^2.2.0",
"node-sass": "^4.1.1",
"nodemon": "^1.11.0",
"pre-commit": "^1.2.2",
Expand Down
2 changes: 2 additions & 0 deletions templates/docs/webpack.config.babel.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import path from 'path';
import webpack from 'webpack';
import CopyWebpackPlugin from 'copy-webpack-plugin';
import StaticSiteGeneratorPlugin from 'static-site-generator-webpack-plugin';
import reactRouterToArray from 'react-router-to-array';
import WatchMissingNodeModulesPlugin from
Expand All @@ -9,6 +10,7 @@ import routes from './src/js/routes';
const env = process.env.NODE_ENV || 'production';

let plugins = [
new CopyWebpackPlugin([{ from: './public' }]),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify(env)
Expand Down

0 comments on commit 19c465a

Please sign in to comment.