From a11418ca3901cf6d3b03e99a4dbad3b9550be8f5 Mon Sep 17 00:00:00 2001 From: Shane Osbourne Date: Tue, 10 Nov 2015 12:43:21 +0000 Subject: [PATCH] Remove comments --- recipes/webpack.babel/app.js | 16 +++------------- recipes/webpack.babel/readme.md | 18 ++++-------------- recipes/webpack.babel/src/main.js | 3 --- 3 files changed, 7 insertions(+), 30 deletions(-) diff --git a/recipes/webpack.babel/app.js b/recipes/webpack.babel/app.js index 66319a9..af7cd15 100644 --- a/recipes/webpack.babel/app.js +++ b/recipes/webpack.babel/app.js @@ -4,7 +4,7 @@ var browserSync = require('browser-sync').create(); var webpack = require('webpack'); var webpackDevMiddleware = require('webpack-dev-middleware'); -var stripAnsi = require('strip-ansi'); +var stripAnsi = require('strip-ansi'); /** * Require ./webpack.config.js and make a bundler from it @@ -14,6 +14,7 @@ var bundler = webpack(webpackConfig); /** * Reload all devices when bundle is complete + * or send a fullscreen error message to the browser instead */ bundler.plugin('done', function (stats) { if (stats.hasErrors() || stats.hasWarnings()) { @@ -35,22 +36,11 @@ browserSync.init({ logFileChanges: false, middleware: [ webpackDevMiddleware(bundler, { - // IMPORTANT: dev middleware can't access config, so we should - // provide publicPath by ourselves publicPath: webpackConfig.output.publicPath, - - // pretty colored output - stats: { - colors: true - } - - // for other settings see - // http://webpack.github.io/docs/webpack-dev-middleware.html + stats: {colors: true} }) ], plugins: ['bs-fullscreen-message'], - // no need to watch '*.js' here, webpack will take care of it for us, - // including full page reloads if HMR won't work files: [ 'app/css/*.css', 'app/*.html' diff --git a/recipes/webpack.babel/readme.md b/recipes/webpack.babel/readme.md index d1fb5ff..9167a8e 100644 --- a/recipes/webpack.babel/readme.md +++ b/recipes/webpack.babel/readme.md @@ -26,7 +26,7 @@ $ npm start ### Additional Info: -Edit any files within SRC +Edit any files within the `src` folder ### Preview of `app.js`: @@ -37,7 +37,7 @@ Edit any files within SRC var browserSync = require('browser-sync').create(); var webpack = require('webpack'); var webpackDevMiddleware = require('webpack-dev-middleware'); -var stripAnsi = require('strip-ansi'); +var stripAnsi = require('strip-ansi'); /** * Require ./webpack.config.js and make a bundler from it @@ -47,6 +47,7 @@ var bundler = webpack(webpackConfig); /** * Reload all devices when bundle is complete + * or send a fullscreen error message to the browser instead */ bundler.plugin('done', function (stats) { if (stats.hasErrors() || stats.hasWarnings()) { @@ -68,22 +69,11 @@ browserSync.init({ logFileChanges: false, middleware: [ webpackDevMiddleware(bundler, { - // IMPORTANT: dev middleware can't access config, so we should - // provide publicPath by ourselves publicPath: webpackConfig.output.publicPath, - - // pretty colored output - stats: { - colors: true - } - - // for other settings see - // http://webpack.github.io/docs/webpack-dev-middleware.html + stats: {colors: true} }) ], plugins: ['bs-fullscreen-message'], - // no need to watch '*.js' here, webpack will take care of it for us, - // including full page reloads if HMR won't work files: [ 'app/css/*.css', 'app/*.html' diff --git a/recipes/webpack.babel/src/main.js b/recipes/webpack.babel/src/main.js index a7873b9..282cac8 100644 --- a/recipes/webpack.babel/src/main.js +++ b/recipes/webpack.babel/src/main.js @@ -1,8 +1,5 @@ import {inc, dec} from './actions'; -// IMPORTANT: it won't work as expected if you'll use addEventListener -// or $(document).ready as it will bind events again and again... -// So you may need some workaround for this or split modules in a particular way window.onload = function() { let number = document.getElementById('number'); let incBtn = document.getElementById('inc');