Permalink
Browse files

removes gulp, adds bin to files

  • Loading branch information...
1 parent e60052f commit 548b72da6c51b0851bca2e4af68dfa915606d48d @flovilmart flovilmart committed Mar 6, 2016
Showing with 55 additions and 34 deletions.
  1. +0 −1 .gitignore
  2. +1 −1 bin/parse-dashboard
  3. +0 −28 gulpfile.js
  4. +4 −4 package.json
  5. +50 −0 webpack/publish.config.js
View
@@ -4,7 +4,6 @@ bundles/
PIG/bundles/
Parse-Dashboard/public/bundles/
Parse-Dashboard/parse-dashboard-config.json
-dist/
npm-debug.log
// vim .swp
View
@@ -1,2 +1,2 @@
#!/usr/bin/env node
-require('../dist/Parse-Dashboard');
+require('../Parse-Dashboard');
View
@@ -1,28 +0,0 @@
-var gulp = require('gulp');
-var webpack = require('webpack');
-var webpackConfig = require("./webpack/production.config");
-
-var dist = './dist/Parse-Dashboard';
-var bundlesDir = './production/bundles';
-
-gulp.task('webpack', function(callback) {
- // run webpack
- webpack(webpackConfig, function(err, stats) {
- if(err) throw new gutil.PluginError('webpack', err);
- callback();
- });
-});
-
-gulp.task('bundles', ['webpack'], function(){
- gulp.src([bundlesDir + '/dashboard.bundle.js', bundlesDir + '/sprites.svg'])
- .pipe(gulp.dest(dist + '/public/bundles/'));
-})
-
-gulp.task('static', ['bundles'], function() {
- gulp.src(['./Parse-Dashboard/**/*', // all files
- '!./Parse-Dashboard/*.json', // but the config
- '!./Parse-Dashboard/public/bundles/*']) // but the bundles
- .pipe(gulp.dest(dist));
-});
-
-gulp.task('default', ['static', 'bundles']);
View
@@ -8,7 +8,8 @@
},
"license": "LicenseRef-LICENSE",
"files": [
- "dist"
+ "Parse-Dashboard",
+ "bin"
],
"dependencies": {
"babel-runtime": "~5.8.25",
@@ -32,7 +33,6 @@
"babel-loader": "~5.3.0",
"babel-plugin-remove-proptypes": "~1.0.0",
"css-loader": "~0.18.0",
- "gulp": "^3.9.1",
"http-server": "~0.8.5",
"immutable-devtools": "~0.0.4",
"jest-cli": "^0.7.1",
@@ -51,8 +51,8 @@
"build": "NODE_ENV=production webpack --config webpack/production.config.js && webpack --config webpack/PIG.config.js",
"test": "NODE_PATH=./node_modules jest",
"generate": "node scripts/generate.js",
- "prepublish": "gulp",
- "start": "node ./dist/Parse-Dashboard/index.js"
+ "prepublish": "webpack --config webpack/publish.config.js --progress",
+ "start": "node ./Parse-Dashboard/index.js"
},
"bin": {
"parse-dashboard": "./bin/parse-dashboard"
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2016-present, Parse, LLC
+ * All rights reserved.
+ *
+ * This source code is licensed under the license found in the LICENSE file in
+ * the root directory of this source tree.
+ */
+var configuration = require('./base.config.js');
+
+configuration.entry = {dashboard: './dashboard/index.js'};
+configuration.output.path = './Parse-Dashboard/public/bundles';
+
+var webpack = require('webpack');
+
+// Add propType removal to Babel
+var loaders = configuration.module.loaders;
+for (var i = 0; i < loaders.length; i++) {
+ if (loaders[i].loader === 'babel-loader') {
+ if (!loaders[i].query.plugins) {
+ loaders[i].query.plugins = [];
+ }
+ loaders[i].query.plugins.push('babel-plugin-remove-proptypes');
+ break;
+ }
+}
+
+// Enable minification
+configuration.plugins.push(
+ new webpack.DefinePlugin({
+ 'process.env': {
+ 'NODE_ENV': '"production"'
+ }
+ }),
+ new webpack.optimize.UglifyJsPlugin({
+ compress: {
+ warnings: false
+ }
+ }),
+ new webpack.optimize.OccurenceOrderPlugin(),
+ function() {
+ this.plugin('done', function(stats) {
+ if (stats.compilation.errors && stats.compilation.errors.length) {
+ console.log(stats.compilation.errors);
+ process.exit(1);
+ }
+ });
+ }
+);
+
+module.exports = configuration;

0 comments on commit 548b72d

Please sign in to comment.