From a1991df7862ccde826ed67f8b5ab00b595066d55 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Sun, 25 Oct 2015 17:45:43 +0100 Subject: [PATCH 01/67] update dependencies --- package.json | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/package.json b/package.json index 45f2dd10c..28c4372c3 100644 --- a/package.json +++ b/package.json @@ -22,34 +22,34 @@ }, "homepage": "https://github.com/Foxandxss/angular-webpack-workflow", "dependencies": { - "angular": "^1.3.16" + "angular": "^1.4.7" }, "devDependencies": { - "angular-mocks": "^1.4.1", - "autoprefixer": "^6.0.2", - "babel-core": "^5.5.8", - "babel-loader": "^5.1.4", - "babel-runtime": "^5.5.8", - "css-loader": "^0.18.0", + "angular-mocks": "^1.4.7", + "autoprefixer": "^6.0.3", + "babel-core": "^5.8.29", + "babel-loader": "^5.3.2", + "babel-runtime": "^5.8.29", + "css-loader": "^0.21.0", "extract-text-webpack-plugin": "^0.8.2", "file-loader": "^0.8.4", - "html-webpack-plugin": "^1.5.2", + "html-webpack-plugin": "^1.6.2", "isparta-instrumenter-loader": "^0.2.1", "jasmine-core": "^2.3.4", - "karma": "^0.13.2", - "karma-coverage": "^0.5.2", - "karma-jasmine": "^0.3.5", - "karma-phantomjs-launcher": "^0.2.0", - "karma-sourcemap-loader": "^0.3.5", - "karma-spec-reporter": "0.0.20", - "karma-webpack": "^1.5.1", - "node-libs-browser": "^0.5.2", + "karma": "^0.13.14", + "karma-coverage": "^0.5.3", + "karma-jasmine": "^0.3.6", + "karma-phantomjs-launcher": "^0.2.1", + "karma-sourcemap-loader": "^0.3.6", + "karma-spec-reporter": "0.0.21", + "karma-webpack": "^1.7.0", + "node-libs-browser": "^0.5.3", "null-loader": "^0.1.1", - "phantomjs": "^1.9.17", - "postcss-loader": "^0.6.0", + "phantomjs": "^1.9.18", + "postcss-loader": "^0.7.0", "raw-loader": "^0.5.1", - "style-loader": "^0.12.3", - "webpack": "^1.9.11", - "webpack-dev-server": "^1.9.0" + "style-loader": "^0.13.0", + "webpack": "^1.12.2", + "webpack-dev-server": "^1.12.1" } } \ No newline at end of file From 3c0a31e6df1311609011b51d626cf6e4a30a9a1c Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Fri, 30 Oct 2015 10:09:32 +0100 Subject: [PATCH 02/67] Remove minification for template Fixes #1 --- webpack.make.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/webpack.make.js b/webpack.make.js index 6ede32021..c3aab7b5e 100644 --- a/webpack.make.js +++ b/webpack.make.js @@ -185,8 +185,7 @@ module.exports = function makeWebpackConfig (options) { config.plugins.push( new HtmlWebpackPlugin({ template: './src/index.html', - inject: 'body', - minify: BUILD + inject: 'body' }) ) } @@ -224,4 +223,4 @@ module.exports = function makeWebpackConfig (options) { }; return config; -}; \ No newline at end of file +}; From 106f81ec4ba1bdb3de9938db86e8d96de9456665 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Thu, 26 Nov 2015 12:44:26 +0100 Subject: [PATCH 03/67] Update babel to babel 6 --- package.json | 11 ++++------- webpack.make.js | 5 ++++- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 28c4372c3..adefeb5d5 100644 --- a/package.json +++ b/package.json @@ -17,9 +17,6 @@ "bugs": { "url": "https://github.com/Foxandxss/angular-webpack-workflow/issues" }, - "babel": { - "stage": 1 - }, "homepage": "https://github.com/Foxandxss/angular-webpack-workflow", "dependencies": { "angular": "^1.4.7" @@ -27,9 +24,9 @@ "devDependencies": { "angular-mocks": "^1.4.7", "autoprefixer": "^6.0.3", - "babel-core": "^5.8.29", - "babel-loader": "^5.3.2", - "babel-runtime": "^5.8.29", + "babel-core": "^6.2.1", + "babel-loader": "^6.2.0", + "babel-preset-es2015": "^6.1.18", "css-loader": "^0.21.0", "extract-text-webpack-plugin": "^0.8.2", "file-loader": "^0.8.4", @@ -52,4 +49,4 @@ "webpack": "^1.12.2", "webpack-dev-server": "^1.12.1" } -} \ No newline at end of file +} diff --git a/webpack.make.js b/webpack.make.js index c3aab7b5e..d15f4e57d 100644 --- a/webpack.make.js +++ b/webpack.make.js @@ -92,7 +92,10 @@ module.exports = function makeWebpackConfig (options) { // Transpile .js files using babel-loader // Compiles ES6 and ES7 into ES5 code test: /\.js$/, - loader: 'babel?optional[]=runtime', + loader: 'babel', + query: { + presets: ['es2015'] + }, exclude: /node_modules/ }, { // ASSET LOADER From 7db65d7ab7838094272036287177d87697c696e4 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Thu, 26 Nov 2015 13:31:09 +0100 Subject: [PATCH 04/67] Update isparta instrumenter to 1.0.0 --- .babelrc | 3 +++ package.json | 2 +- webpack.make.js | 3 --- 3 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 .babelrc diff --git a/.babelrc b/.babelrc new file mode 100644 index 000000000..c13c5f627 --- /dev/null +++ b/.babelrc @@ -0,0 +1,3 @@ +{ + "presets": ["es2015"] +} diff --git a/package.json b/package.json index adefeb5d5..908754400 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "extract-text-webpack-plugin": "^0.8.2", "file-loader": "^0.8.4", "html-webpack-plugin": "^1.6.2", - "isparta-instrumenter-loader": "^0.2.1", + "isparta-instrumenter-loader": "^1.0.0", "jasmine-core": "^2.3.4", "karma": "^0.13.14", "karma-coverage": "^0.5.3", diff --git a/webpack.make.js b/webpack.make.js index d15f4e57d..8e077e92a 100644 --- a/webpack.make.js +++ b/webpack.make.js @@ -93,9 +93,6 @@ module.exports = function makeWebpackConfig (options) { // Compiles ES6 and ES7 into ES5 code test: /\.js$/, loader: 'babel', - query: { - presets: ['es2015'] - }, exclude: /node_modules/ }, { // ASSET LOADER From 7916ead32a0b2dd42234ebe688f70f995e44f31e Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Thu, 26 Nov 2015 19:47:24 +0100 Subject: [PATCH 05/67] Add license in readme --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 4c993f513..ab49ca605 100644 --- a/README.md +++ b/README.md @@ -43,3 +43,7 @@ See what each script does by looking at the `scripts` section in [package.json]( To see how to structure an Angular 1.x application using this workflow, please check [this demo](https://github.com/Foxandxss/GermanWords-ng1-webpack). Also, there is an article in [angular-tips](http://angular-tips.com/blog/2015/06/using-angular-1-dot-x-with-es6-and-webpack/) + +## License + +The license of this workflow is MIT. From 948e3e951af5efa01f8f0ef412674f3855d01cc1 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Sun, 6 Dec 2015 20:40:09 +0100 Subject: [PATCH 06/67] update devDependencies --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 908754400..59673c378 100644 --- a/package.json +++ b/package.json @@ -27,8 +27,8 @@ "babel-core": "^6.2.1", "babel-loader": "^6.2.0", "babel-preset-es2015": "^6.1.18", - "css-loader": "^0.21.0", - "extract-text-webpack-plugin": "^0.8.2", + "css-loader": "^0.23.0", + "extract-text-webpack-plugin": "^0.9.1", "file-loader": "^0.8.4", "html-webpack-plugin": "^1.6.2", "isparta-instrumenter-loader": "^1.0.0", @@ -38,12 +38,12 @@ "karma-jasmine": "^0.3.6", "karma-phantomjs-launcher": "^0.2.1", "karma-sourcemap-loader": "^0.3.6", - "karma-spec-reporter": "0.0.21", + "karma-spec-reporter": "0.0.23", "karma-webpack": "^1.7.0", "node-libs-browser": "^0.5.3", "null-loader": "^0.1.1", "phantomjs": "^1.9.18", - "postcss-loader": "^0.7.0", + "postcss-loader": "^0.8.0", "raw-loader": "^0.5.1", "style-loader": "^0.13.0", "webpack": "^1.12.2", From 68696ddc02536f37bb4db0cecd809d3cea06d588 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Fri, 1 Jan 2016 20:32:18 +0100 Subject: [PATCH 07/67] bump angular version --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 59673c378..a991de39c 100644 --- a/package.json +++ b/package.json @@ -19,10 +19,10 @@ }, "homepage": "https://github.com/Foxandxss/angular-webpack-workflow", "dependencies": { - "angular": "^1.4.7" + "angular": "^1.4.8" }, "devDependencies": { - "angular-mocks": "^1.4.7", + "angular-mocks": "^1.4.8", "autoprefixer": "^6.0.3", "babel-core": "^6.2.1", "babel-loader": "^6.2.0", From 3c6c233a4a0e7def3527a94a7c7556392b0bb185 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Sun, 10 Jan 2016 14:44:33 +0100 Subject: [PATCH 08/67] update devDependencies --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a991de39c..dbc09658a 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "babel-loader": "^6.2.0", "babel-preset-es2015": "^6.1.18", "css-loader": "^0.23.0", - "extract-text-webpack-plugin": "^0.9.1", + "extract-text-webpack-plugin": "^1.0.1", "file-loader": "^0.8.4", "html-webpack-plugin": "^1.6.2", "isparta-instrumenter-loader": "^1.0.0", From 12f9f55f5be82a23a36a178621113e124a8020eb Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Thu, 21 Jan 2016 19:41:16 +0100 Subject: [PATCH 09/67] update devDependencies --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index dbc09658a..331f94a80 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "css-loader": "^0.23.0", "extract-text-webpack-plugin": "^1.0.1", "file-loader": "^0.8.4", - "html-webpack-plugin": "^1.6.2", + "html-webpack-plugin": "^2.7.1", "isparta-instrumenter-loader": "^1.0.0", "jasmine-core": "^2.3.4", "karma": "^0.13.14", From 673a6b6080118c378a501701075d10648f8b076a Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Fri, 29 Jan 2016 19:45:41 +0100 Subject: [PATCH 10/67] chore(build): remove -p flag to not run uglifier twice --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 331f94a80..ab53c8824 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "description": "A workflow for Angular made with Webpack", "scripts": { - "build": "webpack --config webpack.build.js --bail -p", + "build": "webpack --config webpack.build.js --bail", "dev": "webpack-dev-server --history-api-fallback --inline --progress", "test": "karma start", "test:live": "karma start --auto-watch --no-single-run" From 2d04b771ecc6bf97add528bf4aec86828e9b4e96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Rodr=C3=ADguez?= Date: Thu, 4 Feb 2016 20:07:22 +0100 Subject: [PATCH 11/67] chore: remove reference to hot-loader --- webpack.make.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webpack.make.js b/webpack.make.js index 8e077e92a..cf564049d 100644 --- a/webpack.make.js +++ b/webpack.make.js @@ -139,7 +139,7 @@ module.exports = function makeWebpackConfig (options) { // Extract css files in production builds // // Reference: https://github.com/webpack/style-loader - // Use style-loader in development for hot-loading + // Use style-loader in development. loader: ExtractTextPlugin.extract('style', 'css?sourceMap!postcss') }; From dac40d5265ea389646e437c3af3f4a0d6ac851d5 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Wed, 10 Feb 2016 21:37:07 +0100 Subject: [PATCH 12/67] chore: update devDependencies --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index ab53c8824..8d20d48fd 100644 --- a/package.json +++ b/package.json @@ -36,13 +36,13 @@ "karma": "^0.13.14", "karma-coverage": "^0.5.3", "karma-jasmine": "^0.3.6", - "karma-phantomjs-launcher": "^0.2.1", + "karma-phantomjs-launcher": "^1.0.0", "karma-sourcemap-loader": "^0.3.6", - "karma-spec-reporter": "0.0.23", + "karma-spec-reporter": "0.0.24", "karma-webpack": "^1.7.0", - "node-libs-browser": "^0.5.3", + "node-libs-browser": "^1.0.0", "null-loader": "^0.1.1", - "phantomjs": "^1.9.18", + "phantomjs": "^2.1.3", "postcss-loader": "^0.8.0", "raw-loader": "^0.5.1", "style-loader": "^0.13.0", From bcbf14aa5644c486ca08203c41c3b95fcd0d792a Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Thu, 11 Feb 2016 17:50:08 +0100 Subject: [PATCH 13/67] chore(readme): make some minimum changes --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ab49ca605..fa0dd30c9 100644 --- a/README.md +++ b/README.md @@ -9,13 +9,13 @@ It is a direct port of the amazing [react workflow](https://github.com/cesarandr ## Features * Heavily commented webpack configuration with reasonable defaults. -* ES6, and ES7 support with babel.js. +* ES6, and ES7 support with babel. * Source maps included in all builds. * Development server with live reload. * Production builds with cache busting and asset minification. * Testing environment using karma to run tests and jasmine as the framework. * Code coverage when tests are run. -* No gulp and no grunt, just npm run-scripts. +* No gulp and no grunt, just npm scripts. ## Installation From 362848b74dd5730c20a5023acbf487279326276c Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Thu, 11 Feb 2016 18:10:52 +0100 Subject: [PATCH 14/67] rename npm scripts --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 8d20d48fd..8bd375a50 100644 --- a/package.json +++ b/package.json @@ -4,9 +4,10 @@ "description": "A workflow for Angular made with Webpack", "scripts": { "build": "webpack --config webpack.build.js --bail", - "dev": "webpack-dev-server --history-api-fallback --inline --progress", + "server": "webpack-dev-server --history-api-fallback --inline --progress", "test": "karma start", - "test:live": "karma start --auto-watch --no-single-run" + "test-watch": "karma start --auto-watch --no-single-run", + "start": "npm run server" }, "repository": { "type": "git", From 2db1b90d8007f42f3230e4c074f57f0d169bc966 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Thu, 11 Feb 2016 18:12:15 +0100 Subject: [PATCH 15/67] clean dist before building --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 8bd375a50..3826af10f 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "description": "A workflow for Angular made with Webpack", "scripts": { - "build": "webpack --config webpack.build.js --bail", + "build": "rimraf public && webpack --config webpack.build.js --bail", "server": "webpack-dev-server --history-api-fallback --inline --progress", "test": "karma start", "test-watch": "karma start --auto-watch --no-single-run", @@ -46,6 +46,7 @@ "phantomjs": "^2.1.3", "postcss-loader": "^0.8.0", "raw-loader": "^0.5.1", + "rimraf": "^2.5.1", "style-loader": "^0.13.0", "webpack": "^1.12.2", "webpack-dev-server": "^1.12.1" From 9d98703eb57b7a265d424621aede3893065b7297 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Thu, 11 Feb 2016 18:34:57 +0100 Subject: [PATCH 16/67] swap karma launcher for phantomjs2 --- karma.conf.js | 4 ++-- package.json | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/karma.conf.js b/karma.conf.js index 910638bb8..dc260ccb3 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -30,8 +30,8 @@ module.exports = function karmaConfig (config) { }, browsers: [ - // Run tests using PhantomJS - 'PhantomJS' + // Run tests using PhantomJS2 + 'PhantomJS2' ], singleRun: true, diff --git a/package.json b/package.json index 3826af10f..8104c3f35 100644 --- a/package.json +++ b/package.json @@ -37,13 +37,12 @@ "karma": "^0.13.14", "karma-coverage": "^0.5.3", "karma-jasmine": "^0.3.6", - "karma-phantomjs-launcher": "^1.0.0", - "karma-sourcemap-loader": "^0.3.6", + "karma-phantomjs2-launcher": "^0.4.0", + "karma-sourcemap-loader": "^0.3.7", "karma-spec-reporter": "0.0.24", "karma-webpack": "^1.7.0", "node-libs-browser": "^1.0.0", "null-loader": "^0.1.1", - "phantomjs": "^2.1.3", "postcss-loader": "^0.8.0", "raw-loader": "^0.5.1", "rimraf": "^2.5.1", From 1995ec9ceb47e2112c0816cdf338d6a0bd0af6f1 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Thu, 11 Feb 2016 18:43:29 +0100 Subject: [PATCH 17/67] rename tests to use .spec instead of .test --- karma.conf.js | 2 +- src/tests.webpack.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/karma.conf.js b/karma.conf.js index dc260ccb3..3f29933da 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -18,7 +18,7 @@ module.exports = function karmaConfig (config) { ], files: [ - // Grab all files in the app folder that contain .test. + // Grab all files in the app folder that contain .spec. 'src/tests.webpack.js' ], diff --git a/src/tests.webpack.js b/src/tests.webpack.js index fdfe38f1c..953fc3fa5 100644 --- a/src/tests.webpack.js +++ b/src/tests.webpack.js @@ -4,5 +4,5 @@ import 'angular'; import 'angular-mocks/angular-mocks'; -var testsContext = require.context(".", true, /.test$/); +var testsContext = require.context(".", true, /.spec$/); testsContext.keys().forEach(testsContext); \ No newline at end of file From e87deaaa1b17cacd49ce1034e9b890e5276b403a Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Thu, 11 Feb 2016 18:59:18 +0100 Subject: [PATCH 18/67] introduce webpack2 dependencies --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 8104c3f35..219563f0f 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "raw-loader": "^0.5.1", "rimraf": "^2.5.1", "style-loader": "^0.13.0", - "webpack": "^1.12.2", - "webpack-dev-server": "^1.12.1" + "webpack": "^2.0.7-beta", + "webpack-dev-server": "^2.0.0-beta" } } From fc096341372f95b889486c39ccd35285ab1a2689 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Thu, 11 Feb 2016 19:00:21 +0100 Subject: [PATCH 19/67] delete all webpack files and leave just one --- package.json | 2 +- webpack.build.js | 7 -- webpack.config.js | 233 ++++++++++++++++++++++++++++++++++++++++++++-- webpack.make.js | 226 -------------------------------------------- webpack.test.js | 7 -- 5 files changed, 227 insertions(+), 248 deletions(-) delete mode 100644 webpack.build.js delete mode 100644 webpack.make.js delete mode 100644 webpack.test.js diff --git a/package.json b/package.json index 219563f0f..13182dcee 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "description": "A workflow for Angular made with Webpack", "scripts": { - "build": "rimraf public && webpack --config webpack.build.js --bail", + "build": "rimraf public && webpack --bail", "server": "webpack-dev-server --history-api-fallback --inline --progress", "test": "karma start", "test-watch": "karma start --auto-watch --no-single-run", diff --git a/webpack.build.js b/webpack.build.js deleted file mode 100644 index 538153907..000000000 --- a/webpack.build.js +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Webpack config for builds - */ -module.exports = require('./webpack.make')({ - BUILD: true, - TEST: false -}); diff --git a/webpack.config.js b/webpack.config.js index 83b3d7ab9..cf564049d 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,7 +1,226 @@ -/** - * Webpack config for development - */ -module.exports = require('./webpack.make')({ - BUILD: false, - TEST: false -}); +'use strict'; + +// Modules +var webpack = require('webpack'); +var autoprefixer = require('autoprefixer'); +var HtmlWebpackPlugin = require('html-webpack-plugin'); +var ExtractTextPlugin = require('extract-text-webpack-plugin'); + +module.exports = function makeWebpackConfig (options) { + /** + * Environment type + * BUILD is for generating minified builds + * TEST is for generating test builds + */ + var BUILD = !!options.BUILD; + var TEST = !!options.TEST; + + /** + * Config + * Reference: http://webpack.github.io/docs/configuration.html + * This is the object where all configuration gets set + */ + var config = {}; + + /** + * Entry + * Reference: http://webpack.github.io/docs/configuration.html#entry + * Should be an empty object if it's generating a test build + * Karma will set this when it's a test build + */ + if (TEST) { + config.entry = {} + } else { + config.entry = { + app: './src/app.js' + } + } + + /** + * Output + * Reference: http://webpack.github.io/docs/configuration.html#output + * Should be an empty object if it's generating a test build + * Karma will handle setting it up for you when it's a test build + */ + if (TEST) { + config.output = {} + } else { + config.output = { + // Absolute output directory + path: __dirname + '/public', + + // Output path from the view of the page + // Uses webpack-dev-server in development + publicPath: BUILD ? '/' : 'http://localhost:8080/', + + // Filename for entry points + // Only adds hash in build mode + filename: BUILD ? '[name].[hash].js' : '[name].bundle.js', + + // Filename for non-entry points + // Only adds hash in build mode + chunkFilename: BUILD ? '[name].[hash].js' : '[name].bundle.js' + } + } + + /** + * Devtool + * Reference: http://webpack.github.io/docs/configuration.html#devtool + * Type of sourcemap to use per build type + */ + if (TEST) { + config.devtool = 'inline-source-map'; + } else if (BUILD) { + config.devtool = 'source-map'; + } else { + config.devtool = 'eval'; + } + + /** + * Loaders + * Reference: http://webpack.github.io/docs/configuration.html#module-loaders + * List: http://webpack.github.io/docs/list-of-loaders.html + * This handles most of the magic responsible for converting modules + */ + + // Initialize module + config.module = { + preLoaders: [], + loaders: [{ + // JS LOADER + // Reference: https://github.com/babel/babel-loader + // Transpile .js files using babel-loader + // Compiles ES6 and ES7 into ES5 code + test: /\.js$/, + loader: 'babel', + exclude: /node_modules/ + }, { + // ASSET LOADER + // Reference: https://github.com/webpack/file-loader + // Copy png, jpg, jpeg, gif, svg, woff, woff2, ttf, eot files to output + // Rename the file using the asset hash + // Pass along the updated reference to your code + // You can add here any file extension you want to get copied to your output + test: /\.(png|jpg|jpeg|gif|svg|woff|woff2|ttf|eot)$/, + loader: 'file' + }, { + // HTML LOADER + // Reference: https://github.com/webpack/raw-loader + // Allow loading html through js + test: /\.html$/, + loader: 'raw' + }] + }; + + // ISPARTA LOADER + // Reference: https://github.com/ColCh/isparta-instrumenter-loader + // Instrument JS files with Isparta for subsequent code coverage reporting + // Skips node_modules and files that end with .test.js + if (TEST) { + config.module.preLoaders.push({ + test: /\.js$/, + exclude: [ + /node_modules/, + /\.test\.js$/ + ], + loader: 'isparta-instrumenter' + }) + } + + // CSS LOADER + // Reference: https://github.com/webpack/css-loader + // Allow loading css through js + // + // Reference: https://github.com/postcss/postcss-loader + // Postprocess your css with PostCSS plugins + var cssLoader = { + test: /\.css$/, + // Reference: https://github.com/webpack/extract-text-webpack-plugin + // Extract css files in production builds + // + // Reference: https://github.com/webpack/style-loader + // Use style-loader in development. + loader: ExtractTextPlugin.extract('style', 'css?sourceMap!postcss') + }; + + // Skip loading css in test mode + if (TEST) { + // Reference: https://github.com/webpack/null-loader + // Return an empty module + cssLoader.loader = 'null' + } + + // Add cssLoader to the loader list + config.module.loaders.push(cssLoader); + + /** + * PostCSS + * Reference: https://github.com/postcss/autoprefixer-core + * Add vendor prefixes to your css + */ + config.postcss = [ + autoprefixer({ + browsers: ['last 2 version'] + }) + ]; + + /** + * Plugins + * Reference: http://webpack.github.io/docs/configuration.html#plugins + * List: http://webpack.github.io/docs/list-of-plugins.html + */ + config.plugins = [ + // Reference: https://github.com/webpack/extract-text-webpack-plugin + // Extract css files + // Disabled when in test mode or not in build mode + new ExtractTextPlugin('[name].[hash].css', { + disable: !BUILD || TEST + }) + ]; + + // Skip rendering index.html in test mode + if (!TEST) { + // Reference: https://github.com/ampedandwired/html-webpack-plugin + // Render index.html + config.plugins.push( + new HtmlWebpackPlugin({ + template: './src/index.html', + inject: 'body' + }) + ) + } + + // Add build specific plugins + if (BUILD) { + config.plugins.push( + // Reference: http://webpack.github.io/docs/list-of-plugins.html#noerrorsplugin + // Only emit files when there are no errors + new webpack.NoErrorsPlugin(), + + // Reference: http://webpack.github.io/docs/list-of-plugins.html#dedupeplugin + // Dedupe modules in the output + new webpack.optimize.DedupePlugin(), + + // Reference: http://webpack.github.io/docs/list-of-plugins.html#uglifyjsplugin + // Minify all javascript, switch loaders to minimizing mode + new webpack.optimize.UglifyJsPlugin() + ) + } + + /** + * Dev server configuration + * Reference: http://webpack.github.io/docs/configuration.html#devserver + * Reference: http://webpack.github.io/docs/webpack-dev-server.html + */ + config.devServer = { + contentBase: './public', + stats: { + modules: false, + cached: false, + colors: true, + chunk: false + } + }; + + return config; +}; diff --git a/webpack.make.js b/webpack.make.js deleted file mode 100644 index cf564049d..000000000 --- a/webpack.make.js +++ /dev/null @@ -1,226 +0,0 @@ -'use strict'; - -// Modules -var webpack = require('webpack'); -var autoprefixer = require('autoprefixer'); -var HtmlWebpackPlugin = require('html-webpack-plugin'); -var ExtractTextPlugin = require('extract-text-webpack-plugin'); - -module.exports = function makeWebpackConfig (options) { - /** - * Environment type - * BUILD is for generating minified builds - * TEST is for generating test builds - */ - var BUILD = !!options.BUILD; - var TEST = !!options.TEST; - - /** - * Config - * Reference: http://webpack.github.io/docs/configuration.html - * This is the object where all configuration gets set - */ - var config = {}; - - /** - * Entry - * Reference: http://webpack.github.io/docs/configuration.html#entry - * Should be an empty object if it's generating a test build - * Karma will set this when it's a test build - */ - if (TEST) { - config.entry = {} - } else { - config.entry = { - app: './src/app.js' - } - } - - /** - * Output - * Reference: http://webpack.github.io/docs/configuration.html#output - * Should be an empty object if it's generating a test build - * Karma will handle setting it up for you when it's a test build - */ - if (TEST) { - config.output = {} - } else { - config.output = { - // Absolute output directory - path: __dirname + '/public', - - // Output path from the view of the page - // Uses webpack-dev-server in development - publicPath: BUILD ? '/' : 'http://localhost:8080/', - - // Filename for entry points - // Only adds hash in build mode - filename: BUILD ? '[name].[hash].js' : '[name].bundle.js', - - // Filename for non-entry points - // Only adds hash in build mode - chunkFilename: BUILD ? '[name].[hash].js' : '[name].bundle.js' - } - } - - /** - * Devtool - * Reference: http://webpack.github.io/docs/configuration.html#devtool - * Type of sourcemap to use per build type - */ - if (TEST) { - config.devtool = 'inline-source-map'; - } else if (BUILD) { - config.devtool = 'source-map'; - } else { - config.devtool = 'eval'; - } - - /** - * Loaders - * Reference: http://webpack.github.io/docs/configuration.html#module-loaders - * List: http://webpack.github.io/docs/list-of-loaders.html - * This handles most of the magic responsible for converting modules - */ - - // Initialize module - config.module = { - preLoaders: [], - loaders: [{ - // JS LOADER - // Reference: https://github.com/babel/babel-loader - // Transpile .js files using babel-loader - // Compiles ES6 and ES7 into ES5 code - test: /\.js$/, - loader: 'babel', - exclude: /node_modules/ - }, { - // ASSET LOADER - // Reference: https://github.com/webpack/file-loader - // Copy png, jpg, jpeg, gif, svg, woff, woff2, ttf, eot files to output - // Rename the file using the asset hash - // Pass along the updated reference to your code - // You can add here any file extension you want to get copied to your output - test: /\.(png|jpg|jpeg|gif|svg|woff|woff2|ttf|eot)$/, - loader: 'file' - }, { - // HTML LOADER - // Reference: https://github.com/webpack/raw-loader - // Allow loading html through js - test: /\.html$/, - loader: 'raw' - }] - }; - - // ISPARTA LOADER - // Reference: https://github.com/ColCh/isparta-instrumenter-loader - // Instrument JS files with Isparta for subsequent code coverage reporting - // Skips node_modules and files that end with .test.js - if (TEST) { - config.module.preLoaders.push({ - test: /\.js$/, - exclude: [ - /node_modules/, - /\.test\.js$/ - ], - loader: 'isparta-instrumenter' - }) - } - - // CSS LOADER - // Reference: https://github.com/webpack/css-loader - // Allow loading css through js - // - // Reference: https://github.com/postcss/postcss-loader - // Postprocess your css with PostCSS plugins - var cssLoader = { - test: /\.css$/, - // Reference: https://github.com/webpack/extract-text-webpack-plugin - // Extract css files in production builds - // - // Reference: https://github.com/webpack/style-loader - // Use style-loader in development. - loader: ExtractTextPlugin.extract('style', 'css?sourceMap!postcss') - }; - - // Skip loading css in test mode - if (TEST) { - // Reference: https://github.com/webpack/null-loader - // Return an empty module - cssLoader.loader = 'null' - } - - // Add cssLoader to the loader list - config.module.loaders.push(cssLoader); - - /** - * PostCSS - * Reference: https://github.com/postcss/autoprefixer-core - * Add vendor prefixes to your css - */ - config.postcss = [ - autoprefixer({ - browsers: ['last 2 version'] - }) - ]; - - /** - * Plugins - * Reference: http://webpack.github.io/docs/configuration.html#plugins - * List: http://webpack.github.io/docs/list-of-plugins.html - */ - config.plugins = [ - // Reference: https://github.com/webpack/extract-text-webpack-plugin - // Extract css files - // Disabled when in test mode or not in build mode - new ExtractTextPlugin('[name].[hash].css', { - disable: !BUILD || TEST - }) - ]; - - // Skip rendering index.html in test mode - if (!TEST) { - // Reference: https://github.com/ampedandwired/html-webpack-plugin - // Render index.html - config.plugins.push( - new HtmlWebpackPlugin({ - template: './src/index.html', - inject: 'body' - }) - ) - } - - // Add build specific plugins - if (BUILD) { - config.plugins.push( - // Reference: http://webpack.github.io/docs/list-of-plugins.html#noerrorsplugin - // Only emit files when there are no errors - new webpack.NoErrorsPlugin(), - - // Reference: http://webpack.github.io/docs/list-of-plugins.html#dedupeplugin - // Dedupe modules in the output - new webpack.optimize.DedupePlugin(), - - // Reference: http://webpack.github.io/docs/list-of-plugins.html#uglifyjsplugin - // Minify all javascript, switch loaders to minimizing mode - new webpack.optimize.UglifyJsPlugin() - ) - } - - /** - * Dev server configuration - * Reference: http://webpack.github.io/docs/configuration.html#devserver - * Reference: http://webpack.github.io/docs/webpack-dev-server.html - */ - config.devServer = { - contentBase: './public', - stats: { - modules: false, - cached: false, - colors: true, - chunk: false - } - }; - - return config; -}; diff --git a/webpack.test.js b/webpack.test.js deleted file mode 100644 index a67438204..000000000 --- a/webpack.test.js +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Webpack config for tests - */ -module.exports = require('./webpack.make')({ - BUILD: false, - TEST: true -}); From f964f74b5a64165c5d3de37b65f7ecf7c5c1bf61 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Thu, 11 Feb 2016 19:33:13 +0100 Subject: [PATCH 20/67] finish webpack 2 migration --- karma.conf.js | 2 +- package.json | 8 ++-- webpack.config.js | 119 +++++++++++++++++----------------------------- 3 files changed, 49 insertions(+), 80 deletions(-) diff --git a/karma.conf.js b/karma.conf.js index 3f29933da..eec8a1f21 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -42,7 +42,7 @@ module.exports = function karmaConfig (config) { type: 'html' }, - webpack: require('./webpack.test'), + webpack: require('./webpack.config')('test'), // Hide webpack build information from output webpackMiddleware: { diff --git a/package.json b/package.json index 13182dcee..dfa35f1b9 100644 --- a/package.json +++ b/package.json @@ -3,10 +3,10 @@ "version": "1.0.0", "description": "A workflow for Angular made with Webpack", "scripts": { - "build": "rimraf public && webpack --bail", - "server": "webpack-dev-server --history-api-fallback --inline --progress", - "test": "karma start", - "test-watch": "karma start --auto-watch --no-single-run", + "build": "rimraf public && webpack --env prod --bail", + "server": "webpack-dev-server --env dev --history-api-fallback --inline --progress", + "test": "karma start --env test", + "test-watch": "karma start -env test --auto-watch --no-single-run", "start": "npm run server" }, "repository": { diff --git a/webpack.config.js b/webpack.config.js index cf564049d..cbb9f552e 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -6,15 +6,7 @@ var autoprefixer = require('autoprefixer'); var HtmlWebpackPlugin = require('html-webpack-plugin'); var ExtractTextPlugin = require('extract-text-webpack-plugin'); -module.exports = function makeWebpackConfig (options) { - /** - * Environment type - * BUILD is for generating minified builds - * TEST is for generating test builds - */ - var BUILD = !!options.BUILD; - var TEST = !!options.TEST; - +module.exports = function makeWebpackConfig (ENV) { /** * Config * Reference: http://webpack.github.io/docs/configuration.html @@ -28,13 +20,9 @@ module.exports = function makeWebpackConfig (options) { * Should be an empty object if it's generating a test build * Karma will set this when it's a test build */ - if (TEST) { - config.entry = {} - } else { - config.entry = { - app: './src/app.js' - } - } + config.entry = ENV === 'test' ? {} : { + app: './src/app.js' + }; /** * Output @@ -42,38 +30,34 @@ module.exports = function makeWebpackConfig (options) { * Should be an empty object if it's generating a test build * Karma will handle setting it up for you when it's a test build */ - if (TEST) { - config.output = {} - } else { - config.output = { - // Absolute output directory - path: __dirname + '/public', + config.output = ENV === 'test' ? {} : { + // Absolute output directory + path: __dirname + '/public', - // Output path from the view of the page - // Uses webpack-dev-server in development - publicPath: BUILD ? '/' : 'http://localhost:8080/', + // Output path from the view of the page + // Uses webpack-dev-server in development + publicPath: ENV === 'prod' ? '/' : 'http://localhost:8080/', - // Filename for entry points - // Only adds hash in build mode - filename: BUILD ? '[name].[hash].js' : '[name].bundle.js', + // Filename for entry points + // Only adds hash in build mode + filename: ENV === 'prod' ? '[name].[hash].js' : '[name].bundle.js', - // Filename for non-entry points - // Only adds hash in build mode - chunkFilename: BUILD ? '[name].[hash].js' : '[name].bundle.js' - } - } + // Filename for non-entry points + // Only adds hash in build mode + chunkFilename: ENV === 'prod' ? '[name].[hash].js' : '[name].bundle.js' + }; /** * Devtool * Reference: http://webpack.github.io/docs/configuration.html#devtool * Type of sourcemap to use per build type */ - if (TEST) { + if (ENV === 'test') { config.devtool = 'inline-source-map'; - } else if (BUILD) { + } else if (ENV === 'prod') { config.devtool = 'source-map'; } else { - config.devtool = 'eval'; + config.devtool = 'eval-source-map'; } /** @@ -94,6 +78,20 @@ module.exports = function makeWebpackConfig (options) { test: /\.js$/, loader: 'babel', exclude: /node_modules/ + }, { + // CSS LOADER + // Reference: https://github.com/webpack/css-loader + // Allow loading css through js + // + // Reference: https://github.com/postcss/postcss-loader + // Postprocess your css with PostCSS plugins + test: /\.css$/, + // Reference: https://github.com/webpack/extract-text-webpack-plugin + // Extract css files in production builds + // + // Reference: https://github.com/webpack/style-loader + // Use style-loader in development. + loader: ENV === 'test' ? 'null' : ExtractTextPlugin.extract('style', 'css?sourceMap!postcss') }, { // ASSET LOADER // Reference: https://github.com/webpack/file-loader @@ -116,43 +114,17 @@ module.exports = function makeWebpackConfig (options) { // Reference: https://github.com/ColCh/isparta-instrumenter-loader // Instrument JS files with Isparta for subsequent code coverage reporting // Skips node_modules and files that end with .test.js - if (TEST) { + if (ENV === 'test') { config.module.preLoaders.push({ test: /\.js$/, exclude: [ /node_modules/, - /\.test\.js$/ + /\.spec\.js$/ ], loader: 'isparta-instrumenter' }) } - // CSS LOADER - // Reference: https://github.com/webpack/css-loader - // Allow loading css through js - // - // Reference: https://github.com/postcss/postcss-loader - // Postprocess your css with PostCSS plugins - var cssLoader = { - test: /\.css$/, - // Reference: https://github.com/webpack/extract-text-webpack-plugin - // Extract css files in production builds - // - // Reference: https://github.com/webpack/style-loader - // Use style-loader in development. - loader: ExtractTextPlugin.extract('style', 'css?sourceMap!postcss') - }; - - // Skip loading css in test mode - if (TEST) { - // Reference: https://github.com/webpack/null-loader - // Return an empty module - cssLoader.loader = 'null' - } - - // Add cssLoader to the loader list - config.module.loaders.push(cssLoader); - /** * PostCSS * Reference: https://github.com/postcss/autoprefixer-core @@ -169,29 +141,26 @@ module.exports = function makeWebpackConfig (options) { * Reference: http://webpack.github.io/docs/configuration.html#plugins * List: http://webpack.github.io/docs/list-of-plugins.html */ - config.plugins = [ - // Reference: https://github.com/webpack/extract-text-webpack-plugin - // Extract css files - // Disabled when in test mode or not in build mode - new ExtractTextPlugin('[name].[hash].css', { - disable: !BUILD || TEST - }) - ]; + config.plugins = []; // Skip rendering index.html in test mode - if (!TEST) { + if (ENV !== 'test') { // Reference: https://github.com/ampedandwired/html-webpack-plugin // Render index.html config.plugins.push( new HtmlWebpackPlugin({ template: './src/index.html', inject: 'body' - }) + }), + // Reference: https://github.com/webpack/extract-text-webpack-plugin + // Extract css files + // Disabled when in test mode or not in build mode + new ExtractTextPlugin('css/[name].css', {disable: ENV !== 'prod'}) ) } // Add build specific plugins - if (BUILD) { + if (ENV === 'prod') { config.plugins.push( // Reference: http://webpack.github.io/docs/list-of-plugins.html#noerrorsplugin // Only emit files when there are no errors From 18de0e1d8f46f7c1d6c09f73091e4f95393054bc Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Thu, 11 Feb 2016 19:43:25 +0100 Subject: [PATCH 21/67] add webpack 2 note --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index fa0dd30c9..a533d1b27 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,12 @@ -# Angular 1.x WebPack + Babel workflow +# Angular 1.x WebPack 2 + Babel workflow [![Dependency Status](https://david-dm.org/Foxandxss/angular-webpack-workflow/status.svg)](https://david-dm.org/Foxandxss/angular-webpack-workflow#info=dependencies) [![devDependency Status](https://david-dm.org/Foxandxss/angular-webpack-workflow/dev-status.svg)](https://david-dm.org/Foxandxss/angular-webpack-workflow#info=devDependencies) -This workflow serves as a starting point for building Angular 1.x applications using WebPack. Should be noted that apart from the pre-installed angular package, this workflow is pretty much generic. +**NOTE: This workflow is now using Webpack 2 beta. There is a branch with the old workflow if you want to use it.** -It is a direct port of the amazing [react workflow](https://github.com/cesarandreu/web-app) of [Cesar Andreu](https://github.com/cesarandreu). All the credits goes for him. +**NOTE 2: THIS IS STILL WIP, I WILL REMOVE THIS CAPS WHEN I AM SURE IT WORKS PERFECTLY.** + +This workflow serves as a starting point for building Angular 1.x applications using WebPack 2. Should be noted that apart from the pre-installed angular package, this workflow is pretty much generic. ## Features From e35cf8b4902d822325d162d9bedb4d2a1a3461e9 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Thu, 11 Feb 2016 19:43:44 +0100 Subject: [PATCH 22/67] change scripts on readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a533d1b27..471d4ea14 100644 --- a/README.md +++ b/README.md @@ -34,9 +34,9 @@ $ npm install All scripts are run with `npm run [script]`, for example: `npm run test`. * `build` - generate a minified build to dist folder -* `dev` - start development server, try it by opening `http://localhost:8080/` +* `start` - start development server, try it by opening `http://localhost:8080/` * `test` - run all tests -* `test:live` - continuously run unit tests watching for changes +* `test-live` - continuously run unit tests watching for changes See what each script does by looking at the `scripts` section in [package.json](./package.json). From b14d274947f23d5c14855796979c3b846e9542f6 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Thu, 11 Feb 2016 20:49:49 +0100 Subject: [PATCH 23/67] fix test-watch on readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 471d4ea14..532d8f358 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ All scripts are run with `npm run [script]`, for example: `npm run test`. * `build` - generate a minified build to dist folder * `start` - start development server, try it by opening `http://localhost:8080/` * `test` - run all tests -* `test-live` - continuously run unit tests watching for changes +* `test-watch` - continuously run unit tests watching for changes See what each script does by looking at the `scripts` section in [package.json](./package.json). From c98085103267b8dc50efa52e39fbb2dc50f8b7d3 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Thu, 11 Feb 2016 20:53:29 +0100 Subject: [PATCH 24/67] Add a note on the article version --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 532d8f358..f1b4b6111 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ See what each script does by looking at the `scripts` section in [package.json]( To see how to structure an Angular 1.x application using this workflow, please check [this demo](https://github.com/Foxandxss/GermanWords-ng1-webpack). -Also, there is an article in [angular-tips](http://angular-tips.com/blog/2015/06/using-angular-1-dot-x-with-es6-and-webpack/) +Also, there is an article in [angular-tips](http://angular-tips.com/blog/2015/06/using-angular-1-dot-x-with-es6-and-webpack/). The article is based on the Webpack 1 version, but almost everything is applicable here. ## License From ee9c974f2e3980bd6c0d3dbd51667d3f4c0034d5 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Thu, 11 Feb 2016 21:48:33 +0100 Subject: [PATCH 25/67] show a coverage summary after test --- karma.conf.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/karma.conf.js b/karma.conf.js index eec8a1f21..38b7ed601 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -10,7 +10,7 @@ module.exports = function karmaConfig (config) { reporters: [ // Reference: https://github.com/mlex/karma-spec-reporter // Set reporter to print detailed results to console - 'spec', + 'progress', // Reference: https://github.com/karma-runner/karma-coverage // Output code coverage files @@ -39,7 +39,10 @@ module.exports = function karmaConfig (config) { // Configure code coverage reporter coverageReporter: { dir: 'build/coverage/', - type: 'html' + reporters: [ + {type: 'text-summary'}, + {type: 'html'} + ] }, webpack: require('./webpack.config')('test'), From baed0444b6b4f7185bf22106e7d5ca6683935419 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Fri, 12 Feb 2016 15:01:03 +0100 Subject: [PATCH 26/67] update dependencies --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index dfa35f1b9..b555b744d 100644 --- a/package.json +++ b/package.json @@ -20,10 +20,10 @@ }, "homepage": "https://github.com/Foxandxss/angular-webpack-workflow", "dependencies": { - "angular": "^1.4.8" + "angular": "^1.5.0" }, "devDependencies": { - "angular-mocks": "^1.4.8", + "angular-mocks": "^1.5.0", "autoprefixer": "^6.0.3", "babel-core": "^6.2.1", "babel-loader": "^6.2.0", @@ -37,7 +37,7 @@ "karma": "^0.13.14", "karma-coverage": "^0.5.3", "karma-jasmine": "^0.3.6", - "karma-phantomjs2-launcher": "^0.4.0", + "karma-phantomjs2-launcher": "^0.5.0", "karma-sourcemap-loader": "^0.3.7", "karma-spec-reporter": "0.0.24", "karma-webpack": "^1.7.0", From e5e74a6f0e38883a2a448db8bd262d846aabdf2f Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Fri, 12 Feb 2016 15:21:21 +0100 Subject: [PATCH 27/67] add public folder to contain static assets --- .gitignore | 2 +- package.json | 1 + src/public/img/favicon.ico | Bin 0 -> 5430 bytes src/{ => public}/index.html | 2 ++ webpack.config.js | 14 +++++++++++--- 5 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 src/public/img/favicon.ico rename src/{ => public}/index.html (72%) diff --git a/.gitignore b/.gitignore index c65a39ba7..be3f7171e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ node_modules -public +public/ build \ No newline at end of file diff --git a/package.json b/package.json index b555b744d..23bcd0940 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "babel-core": "^6.2.1", "babel-loader": "^6.2.0", "babel-preset-es2015": "^6.1.18", + "copy-webpack-plugin": "^1.1.1", "css-loader": "^0.23.0", "extract-text-webpack-plugin": "^1.0.1", "file-loader": "^0.8.4", diff --git a/src/public/img/favicon.ico b/src/public/img/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..8081c7ceaf2be08bf59010158c586170d9d2d517 GIT binary patch literal 5430 zcmc(je{54#6vvCoAI3i*G5%$U7!sA3wtMZ$fH6V9C`=eXGJb@R1%(I_{vnZtpD{6n z5Pl{DmxzBDbrB>}`90e12m8T*36WoeDLA&SD_hw{H^wM!cl_RWcVA!I+x87ee975; z@4kD^=bYPn&pmG@(+JZ`rqQEKxW<}RzhW}I!|ulN=fmjVi@x{p$cC`)5$a!)X&U+blKNv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$dLP6+SmPn= z8zjm4jGjN772R{FGkXwcNv8GBcZI#@Y2m{RNF_w8(Z%^A*!bS*!}s6sh*NnURytky humW;*g7R+&|Ledvc- Angular App + + diff --git a/webpack.config.js b/webpack.config.js index cbb9f552e..953b0059b 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -5,6 +5,7 @@ var webpack = require('webpack'); var autoprefixer = require('autoprefixer'); var HtmlWebpackPlugin = require('html-webpack-plugin'); var ExtractTextPlugin = require('extract-text-webpack-plugin'); +var CopyWebpackPlugin = require('copy-webpack-plugin'); module.exports = function makeWebpackConfig (ENV) { /** @@ -149,9 +150,10 @@ module.exports = function makeWebpackConfig (ENV) { // Render index.html config.plugins.push( new HtmlWebpackPlugin({ - template: './src/index.html', + template: './src/public/index.html', inject: 'body' }), + // Reference: https://github.com/webpack/extract-text-webpack-plugin // Extract css files // Disabled when in test mode or not in build mode @@ -172,7 +174,13 @@ module.exports = function makeWebpackConfig (ENV) { // Reference: http://webpack.github.io/docs/list-of-plugins.html#uglifyjsplugin // Minify all javascript, switch loaders to minimizing mode - new webpack.optimize.UglifyJsPlugin() + new webpack.optimize.UglifyJsPlugin(), + + // Copy assets from the public folder + // Reference: https://github.com/kevlened/copy-webpack-plugin + new CopyWebpackPlugin([{ + from: __dirname + '/src/public' + }]) ) } @@ -182,7 +190,7 @@ module.exports = function makeWebpackConfig (ENV) { * Reference: http://webpack.github.io/docs/webpack-dev-server.html */ config.devServer = { - contentBase: './public', + contentBase: './src/public', stats: { modules: false, cached: false, From 4bd0beb8a79f29ca6984b7d2716e5ef0bf5cbb64 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Fri, 12 Feb 2016 15:23:39 +0100 Subject: [PATCH 28/67] make build more verbose --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 23bcd0940..b39983284 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "description": "A workflow for Angular made with Webpack", "scripts": { - "build": "rimraf public && webpack --env prod --bail", + "build": "rimraf public && webpack --env prod --bail --progress --profile", "server": "webpack-dev-server --env dev --history-api-fallback --inline --progress", "test": "karma start --env test", "test-watch": "karma start -env test --auto-watch --no-single-run", From 0fbc53feb22eaed01ec80bd7c5e2f74819b0ede6 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Fri, 12 Feb 2016 15:25:49 +0100 Subject: [PATCH 29/67] remove assets minification, it is partially true now --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f1b4b6111..e9f6741e4 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ This workflow serves as a starting point for building Angular 1.x applications u * ES6, and ES7 support with babel. * Source maps included in all builds. * Development server with live reload. -* Production builds with cache busting and asset minification. +* Production builds with cache busting. * Testing environment using karma to run tests and jasmine as the framework. * Code coverage when tests are run. * No gulp and no grunt, just npm scripts. From 5624666a96898de1f6ea2317123302b1e3c8021a Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Fri, 12 Feb 2016 15:59:59 +0100 Subject: [PATCH 30/67] finish update to new standards --- .gitignore | 2 +- README.md | 8 +++----- src/{ => app}/app.js | 0 webpack.config.js | 6 +++--- 4 files changed, 7 insertions(+), 9 deletions(-) rename src/{ => app}/app.js (100%) diff --git a/.gitignore b/.gitignore index be3f7171e..0e796c3f1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ node_modules -public/ +dist build \ No newline at end of file diff --git a/README.md b/README.md index e9f6741e4..7162e665c 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,10 @@ -# Angular 1.x WebPack 2 + Babel workflow +# Angular 1.x Webpack 2 + Babel workflow [![Dependency Status](https://david-dm.org/Foxandxss/angular-webpack-workflow/status.svg)](https://david-dm.org/Foxandxss/angular-webpack-workflow#info=dependencies) [![devDependency Status](https://david-dm.org/Foxandxss/angular-webpack-workflow/dev-status.svg)](https://david-dm.org/Foxandxss/angular-webpack-workflow#info=devDependencies) **NOTE: This workflow is now using Webpack 2 beta. There is a branch with the old workflow if you want to use it.** -**NOTE 2: THIS IS STILL WIP, I WILL REMOVE THIS CAPS WHEN I AM SURE IT WORKS PERFECTLY.** - -This workflow serves as a starting point for building Angular 1.x applications using WebPack 2. Should be noted that apart from the pre-installed angular package, this workflow is pretty much generic. +This workflow serves as a starting point for building Angular 1.x applications using Webpack 2. Should be noted that apart from the pre-installed angular package, this workflow is pretty much generic. ## Features @@ -31,7 +29,7 @@ $ npm install ## Scripts -All scripts are run with `npm run [script]`, for example: `npm run test`. +All scripts are run with `npm run [script]`, for example: `npm run build`. * `build` - generate a minified build to dist folder * `start` - start development server, try it by opening `http://localhost:8080/` diff --git a/src/app.js b/src/app/app.js similarity index 100% rename from src/app.js rename to src/app/app.js diff --git a/webpack.config.js b/webpack.config.js index 953b0059b..28ea310db 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -22,7 +22,7 @@ module.exports = function makeWebpackConfig (ENV) { * Karma will set this when it's a test build */ config.entry = ENV === 'test' ? {} : { - app: './src/app.js' + app: './src/app/app.js' }; /** @@ -33,7 +33,7 @@ module.exports = function makeWebpackConfig (ENV) { */ config.output = ENV === 'test' ? {} : { // Absolute output directory - path: __dirname + '/public', + path: __dirname + '/dist', // Output path from the view of the page // Uses webpack-dev-server in development @@ -157,7 +157,7 @@ module.exports = function makeWebpackConfig (ENV) { // Reference: https://github.com/webpack/extract-text-webpack-plugin // Extract css files // Disabled when in test mode or not in build mode - new ExtractTextPlugin('css/[name].css', {disable: ENV !== 'prod'}) + new ExtractTextPlugin('[name].[hash].css', {disable: ENV !== 'prod'}) ) } From ea6937cb61a53d5e5189038310f9a880958ecddb Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Mon, 15 Feb 2016 13:05:24 +0100 Subject: [PATCH 31/67] update readme to preboot organization --- README.md | 85 +++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 64 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 7162e665c..40ac77c3b 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ -# Angular 1.x Webpack 2 + Babel workflow +# angular-webpack -[![Dependency Status](https://david-dm.org/Foxandxss/angular-webpack-workflow/status.svg)](https://david-dm.org/Foxandxss/angular-webpack-workflow#info=dependencies) [![devDependency Status](https://david-dm.org/Foxandxss/angular-webpack-workflow/dev-status.svg)](https://david-dm.org/Foxandxss/angular-webpack-workflow#info=devDependencies) +[![Dependency Status](https://david-dm.org/preboot/angular-webpack/status.svg)](https://david-dm.org/preboot/angular-webpack#info=dependencies) [![devDependency Status](https://david-dm.org/preboot/angular-webpack/dev-status.svg)](https://david-dm.org/preboot/angular-webpack#info=devDependencies) + +A complete, yet simple, starter for Angular using webpack 2. **NOTE: This workflow is now using Webpack 2 beta. There is a branch with the old workflow if you want to use it.** This workflow serves as a starting point for building Angular 1.x applications using Webpack 2. Should be noted that apart from the pre-installed angular package, this workflow is pretty much generic. -## Features - * Heavily commented webpack configuration with reasonable defaults. * ES6, and ES7 support with babel. * Source maps included in all builds. @@ -17,33 +17,76 @@ This workflow serves as a starting point for building Angular 1.x applications u * Code coverage when tests are run. * No gulp and no grunt, just npm scripts. -## Installation +>Warning: Make sure you're using the latest version of Node.js and NPM + +[Is Angular 2 Ready Yet?](http://splintercode.github.io/is-angular-2-ready/) + +### Quick start + +> Clone/Download the repo then edit `app.js` inside [`/src/app/app.js`](/src/app/app.js) -To use it, just clone this repo and install the npm dependencies: +```bash +# clone our repo +$ git clone https://github.com/preboot/angular-webpack.git my-app -```shell -$ git clone https://github.com/Foxandxss/angular-webpack-workflow my_app -$ cd my_app +# change directory to your +$ cd my-app + +# install the dependencies with npm $ npm install + +# start the server +$ npm start +``` +go to [http://localhost:8080](http://localhost:8080) in your browser. + +# Table of Contents + +* [Getting Started](#getting-started) + * [Dependencies](#dependencies) + * [Installing](#installing) + * [Running the app](#running-the-app) + * [Developing](#developing) + * [Testing](#testing) +* [License](#license) + +# Getting Started + +## Dependencies + +What you need to run this app: +* `node` and `npm` (Use [NVM](https://github.com/creationix/nvm)) +* Ensure you're running Node (`v4.1.x`+) and NPM (`2.14.x`+) + +## Installing + +* `fork` this repo +* `clone` your fork +* `npm install` to install all dependencies + +## Running the app + +After you have installed all dependencies you can now run the app with: +```bash +npm start ``` -## Scripts +It will start a local server using `webpack-dev-server` which will watch, build (in-memory), and reload for you. The port will be displayed to you as `http://localhost:8080`. -All scripts are run with `npm run [script]`, for example: `npm run build`. +## Developing -* `build` - generate a minified build to dist folder -* `start` - start development server, try it by opening `http://localhost:8080/` -* `test` - run all tests -* `test-watch` - continuously run unit tests watching for changes +### Build files -See what each script does by looking at the `scripts` section in [package.json](./package.json). +* single run: `npm run build` +* build files and watch: `npm run watch` -## Example and tutorial +## Testing -To see how to structure an Angular 1.x application using this workflow, please check [this demo](https://github.com/Foxandxss/GermanWords-ng1-webpack). +#### 1. Unit Tests -Also, there is an article in [angular-tips](http://angular-tips.com/blog/2015/06/using-angular-1-dot-x-with-es6-and-webpack/). The article is based on the Webpack 1 version, but almost everything is applicable here. +* single run: `npm test` +* live mode (TDD style): `npm run test-watch` -## License +# License -The license of this workflow is MIT. +[MIT](/LICENSE) From 1e396bd34e5e34994be15e8805060e63c6b678de Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Mon, 15 Feb 2016 13:08:59 +0100 Subject: [PATCH 32/67] missing word on readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 40ac77c3b..ebd6875f4 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ This workflow serves as a starting point for building Angular 1.x applications u # clone our repo $ git clone https://github.com/preboot/angular-webpack.git my-app -# change directory to your +# change directory to your app $ cd my-app # install the dependencies with npm From 50e04284de20945c2955fb087e3d70fb5dff703a Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Mon, 15 Feb 2016 14:35:33 +0100 Subject: [PATCH 33/67] Add license file --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..b06f77326 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2016 Preboot team + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. From 861b01e7f23ce0246b0d311fe145e9879d35d56c Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Tue, 16 Feb 2016 15:27:46 +0100 Subject: [PATCH 34/67] revert to webpack 1 --- README.md | 9 +++------ karma.conf.js | 2 +- package.json | 12 ++++++------ webpack.config.js | 22 ++++++++++++++-------- 4 files changed, 24 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index ebd6875f4..033ce50bf 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,9 @@ [![Dependency Status](https://david-dm.org/preboot/angular-webpack/status.svg)](https://david-dm.org/preboot/angular-webpack#info=dependencies) [![devDependency Status](https://david-dm.org/preboot/angular-webpack/dev-status.svg)](https://david-dm.org/preboot/angular-webpack#info=devDependencies) -A complete, yet simple, starter for Angular using webpack 2. +A complete, yet simple, starter for Angular using Webpack. -**NOTE: This workflow is now using Webpack 2 beta. There is a branch with the old workflow if you want to use it.** - -This workflow serves as a starting point for building Angular 1.x applications using Webpack 2. Should be noted that apart from the pre-installed angular package, this workflow is pretty much generic. +This workflow serves as a starting point for building Angular 1.x applications using Webpack. Should be noted that apart from the pre-installed angular package, this workflow is pretty much generic. * Heavily commented webpack configuration with reasonable defaults. * ES6, and ES7 support with babel. @@ -19,8 +17,6 @@ This workflow serves as a starting point for building Angular 1.x applications u >Warning: Make sure you're using the latest version of Node.js and NPM -[Is Angular 2 Ready Yet?](http://splintercode.github.io/is-angular-2-ready/) - ### Quick start > Clone/Download the repo then edit `app.js` inside [`/src/app/app.js`](/src/app/app.js) @@ -38,6 +34,7 @@ $ npm install # start the server $ npm start ``` + go to [http://localhost:8080](http://localhost:8080) in your browser. # Table of Contents diff --git a/karma.conf.js b/karma.conf.js index 38b7ed601..524dc2190 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -45,7 +45,7 @@ module.exports = function karmaConfig (config) { ] }, - webpack: require('./webpack.config')('test'), + webpack: require('./webpack.config'), // Hide webpack build information from output webpackMiddleware: { diff --git a/package.json b/package.json index b39983284..3aef34ecb 100644 --- a/package.json +++ b/package.json @@ -3,10 +3,10 @@ "version": "1.0.0", "description": "A workflow for Angular made with Webpack", "scripts": { - "build": "rimraf public && webpack --env prod --bail --progress --profile", - "server": "webpack-dev-server --env dev --history-api-fallback --inline --progress", - "test": "karma start --env test", - "test-watch": "karma start -env test --auto-watch --no-single-run", + "build": "rimraf public && webpack --bail --progress --profile", + "server": "webpack-dev-server --history-api-fallback --inline --progress", + "test": "karma start", + "test-watch": "karma start --auto-watch --no-single-run", "start": "npm run server" }, "repository": { @@ -48,7 +48,7 @@ "raw-loader": "^0.5.1", "rimraf": "^2.5.1", "style-loader": "^0.13.0", - "webpack": "^2.0.7-beta", - "webpack-dev-server": "^2.0.0-beta" + "webpack": "^1.12.13", + "webpack-dev-server": "^1.14.1" } } diff --git a/webpack.config.js b/webpack.config.js index 28ea310db..adc8d7ded 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -7,7 +7,13 @@ var HtmlWebpackPlugin = require('html-webpack-plugin'); var ExtractTextPlugin = require('extract-text-webpack-plugin'); var CopyWebpackPlugin = require('copy-webpack-plugin'); -module.exports = function makeWebpackConfig (ENV) { +/** + * Env + * Get npm lifecycle event to identify the environment + */ +var ENV = process.env.npm_lifecycle_event; + +module.exports = function makeWebpackConfig () { /** * Config * Reference: http://webpack.github.io/docs/configuration.html @@ -37,15 +43,15 @@ module.exports = function makeWebpackConfig (ENV) { // Output path from the view of the page // Uses webpack-dev-server in development - publicPath: ENV === 'prod' ? '/' : 'http://localhost:8080/', + publicPath: ENV === 'build' ? '/' : 'http://localhost:8080/', // Filename for entry points // Only adds hash in build mode - filename: ENV === 'prod' ? '[name].[hash].js' : '[name].bundle.js', + filename: ENV === 'build' ? '[name].[hash].js' : '[name].bundle.js', // Filename for non-entry points // Only adds hash in build mode - chunkFilename: ENV === 'prod' ? '[name].[hash].js' : '[name].bundle.js' + chunkFilename: ENV === 'build' ? '[name].[hash].js' : '[name].bundle.js' }; /** @@ -55,7 +61,7 @@ module.exports = function makeWebpackConfig (ENV) { */ if (ENV === 'test') { config.devtool = 'inline-source-map'; - } else if (ENV === 'prod') { + } else if (ENV === 'build') { config.devtool = 'source-map'; } else { config.devtool = 'eval-source-map'; @@ -157,12 +163,12 @@ module.exports = function makeWebpackConfig (ENV) { // Reference: https://github.com/webpack/extract-text-webpack-plugin // Extract css files // Disabled when in test mode or not in build mode - new ExtractTextPlugin('[name].[hash].css', {disable: ENV !== 'prod'}) + new ExtractTextPlugin('[name].[hash].css', {disable: ENV !== 'build'}) ) } // Add build specific plugins - if (ENV === 'prod') { + if (ENV === 'build') { config.plugins.push( // Reference: http://webpack.github.io/docs/list-of-plugins.html#noerrorsplugin // Only emit files when there are no errors @@ -200,4 +206,4 @@ module.exports = function makeWebpackConfig (ENV) { }; return config; -}; +}(); From e345a85c7104ebf85a63e07e05fb2d7d4a2d507c Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Tue, 16 Feb 2016 15:28:21 +0100 Subject: [PATCH 35/67] fix directory to clean before build --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3aef34ecb..7b0b29f2c 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "description": "A workflow for Angular made with Webpack", "scripts": { - "build": "rimraf public && webpack --bail --progress --profile", + "build": "rimraf dist && webpack --bail --progress --profile", "server": "webpack-dev-server --history-api-fallback --inline --progress", "test": "karma start", "test-watch": "karma start --auto-watch --no-single-run", From 65c744e661287220be6c57c5e3231c55bd2189ed Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Tue, 16 Feb 2016 15:28:58 +0100 Subject: [PATCH 36/67] change coverage output directory --- .gitignore | 2 +- karma.conf.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 0e796c3f1..5a19e8ace 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ node_modules dist -build \ No newline at end of file +coverage \ No newline at end of file diff --git a/karma.conf.js b/karma.conf.js index 524dc2190..4cf266ad2 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -38,7 +38,7 @@ module.exports = function karmaConfig (config) { // Configure code coverage reporter coverageReporter: { - dir: 'build/coverage/', + dir: 'coverage/', reporters: [ {type: 'text-summary'}, {type: 'html'} From 450728460458ae9264a2f87863cbc2a1ca55553c Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Sun, 21 Feb 2016 18:28:16 +0100 Subject: [PATCH 37/67] reduce webpack verbosity --- karma.conf.js | 2 +- webpack.config.js | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/karma.conf.js b/karma.conf.js index 4cf266ad2..d921cb97c 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -49,7 +49,7 @@ module.exports = function karmaConfig (config) { // Hide webpack build information from output webpackMiddleware: { - noInfo: true + noInfo: 'errors-only' } }); }; diff --git a/webpack.config.js b/webpack.config.js index adc8d7ded..8ae8e550a 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -197,12 +197,7 @@ module.exports = function makeWebpackConfig () { */ config.devServer = { contentBase: './src/public', - stats: { - modules: false, - cached: false, - colors: true, - chunk: false - } + stats: 'minimal' }; return config; From a88cdb8a4d1e821f4a3aa028789c861302f7adba Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Wed, 2 Mar 2016 13:13:27 +0100 Subject: [PATCH 38/67] fix test-watch --- webpack.config.js | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index 8ae8e550a..b443019f4 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -12,6 +12,8 @@ var CopyWebpackPlugin = require('copy-webpack-plugin'); * Get npm lifecycle event to identify the environment */ var ENV = process.env.npm_lifecycle_event; +var isTest = ENV === 'test' || ENV === 'test-watch'; +var isProd = ENV === 'build'; module.exports = function makeWebpackConfig () { /** @@ -27,7 +29,7 @@ module.exports = function makeWebpackConfig () { * Should be an empty object if it's generating a test build * Karma will set this when it's a test build */ - config.entry = ENV === 'test' ? {} : { + config.entry = isTest ? {} : { app: './src/app/app.js' }; @@ -37,21 +39,21 @@ module.exports = function makeWebpackConfig () { * Should be an empty object if it's generating a test build * Karma will handle setting it up for you when it's a test build */ - config.output = ENV === 'test' ? {} : { + config.output = isTest ? {} : { // Absolute output directory path: __dirname + '/dist', // Output path from the view of the page // Uses webpack-dev-server in development - publicPath: ENV === 'build' ? '/' : 'http://localhost:8080/', + publicPath: isProd ? '/' : 'http://localhost:8080/', // Filename for entry points // Only adds hash in build mode - filename: ENV === 'build' ? '[name].[hash].js' : '[name].bundle.js', + filename: isProd ? '[name].[hash].js' : '[name].bundle.js', // Filename for non-entry points // Only adds hash in build mode - chunkFilename: ENV === 'build' ? '[name].[hash].js' : '[name].bundle.js' + chunkFilename: isProd ? '[name].[hash].js' : '[name].bundle.js' }; /** @@ -59,9 +61,9 @@ module.exports = function makeWebpackConfig () { * Reference: http://webpack.github.io/docs/configuration.html#devtool * Type of sourcemap to use per build type */ - if (ENV === 'test') { + if (isTest) { config.devtool = 'inline-source-map'; - } else if (ENV === 'build') { + } else if (isProd) { config.devtool = 'source-map'; } else { config.devtool = 'eval-source-map'; @@ -98,7 +100,7 @@ module.exports = function makeWebpackConfig () { // // Reference: https://github.com/webpack/style-loader // Use style-loader in development. - loader: ENV === 'test' ? 'null' : ExtractTextPlugin.extract('style', 'css?sourceMap!postcss') + loader: isTest ? 'null' : ExtractTextPlugin.extract('style', 'css?sourceMap!postcss') }, { // ASSET LOADER // Reference: https://github.com/webpack/file-loader @@ -121,7 +123,7 @@ module.exports = function makeWebpackConfig () { // Reference: https://github.com/ColCh/isparta-instrumenter-loader // Instrument JS files with Isparta for subsequent code coverage reporting // Skips node_modules and files that end with .test.js - if (ENV === 'test') { + if (isTest) { config.module.preLoaders.push({ test: /\.js$/, exclude: [ @@ -151,7 +153,7 @@ module.exports = function makeWebpackConfig () { config.plugins = []; // Skip rendering index.html in test mode - if (ENV !== 'test') { + if (!isTest) { // Reference: https://github.com/ampedandwired/html-webpack-plugin // Render index.html config.plugins.push( @@ -163,12 +165,12 @@ module.exports = function makeWebpackConfig () { // Reference: https://github.com/webpack/extract-text-webpack-plugin // Extract css files // Disabled when in test mode or not in build mode - new ExtractTextPlugin('[name].[hash].css', {disable: ENV !== 'build'}) + new ExtractTextPlugin('[name].[hash].css', {disable: !isProd}) ) } // Add build specific plugins - if (ENV === 'build') { + if (isProd) { config.plugins.push( // Reference: http://webpack.github.io/docs/list-of-plugins.html#noerrorsplugin // Only emit files when there are no errors From 0499f98410599fa697daa5a34cc057dfbfe29adf Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Wed, 2 Mar 2016 13:21:34 +0100 Subject: [PATCH 39/67] add a minimal application with tests --- src/app/app.html | 9 +++++++++ src/app/app.js | 24 +++++++++++++++++++++++- src/app/app.spec.js | 20 ++++++++++++++++++++ src/public/img/logo.png | Bin 0 -> 21479 bytes src/public/index.html | 2 +- src/style/app.css | 22 ++++++++++++++++++++++ 6 files changed, 75 insertions(+), 2 deletions(-) create mode 100644 src/app/app.html create mode 100644 src/app/app.spec.js create mode 100644 src/public/img/logo.png create mode 100644 src/style/app.css diff --git a/src/app/app.html b/src/app/app.html new file mode 100644 index 000000000..29501db8c --- /dev/null +++ b/src/app/app.html @@ -0,0 +1,9 @@ +
+

Hello from Angular !

+ + + +
+ \ No newline at end of file diff --git a/src/app/app.js b/src/app/app.js index 0300163f5..d5e26c84a 100644 --- a/src/app/app.js +++ b/src/app/app.js @@ -1,3 +1,25 @@ import angular from 'angular'; -angular.module('app', []); \ No newline at end of file +import '../style/app.css'; + +let app = () => { + return { + template: require('./app.html'), + controller: 'AppCtrl', + controllerAs: 'app' + } +}; + +class AppCtrl { + constructor() { + this.url = 'https://github.com/preboot/angular-webpack'; + } +} + +const MODULE_NAME = 'app'; + +angular.module(MODULE_NAME, []) + .directive('app', app) + .controller('AppCtrl', AppCtrl); + +export default MODULE_NAME; \ No newline at end of file diff --git a/src/app/app.spec.js b/src/app/app.spec.js new file mode 100644 index 000000000..200e50649 --- /dev/null +++ b/src/app/app.spec.js @@ -0,0 +1,20 @@ +import app from './app'; + +describe('app', () => { + + describe('AppCtrl', () => { + let ctrl; + + beforeEach(() => { + angular.mock.module(app); + + angular.mock.inject(($controller) => { + ctrl = $controller('AppCtrl', {}); + }); + }); + + it('should contain the starter url', () => { + expect(ctrl.url).toBe('https://github.com/preboot/angular-webpack'); + }); + }); +}); \ No newline at end of file diff --git a/src/public/img/logo.png b/src/public/img/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..68fe30784b2ec603eac20120914cfcc9b37ac32d GIT binary patch literal 21479 zcmXtA1yodBv>s9z8b-Q77^FkMAsvPi>28o#QW}&Vx>2NINC|1_Mgajy=@z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R9Zf94Zx^Hc)2zW&+Z z#y}LGoqD4)#zwlxcfX!fcdZzrR}{kbqLq&;s;UD~$fCpRs#%UzC&rnPLbadbLKfDj zc5N<{6RW=8u{~!uZ>n}7Co36E^qh09BTD$yY`t zqnGrkO0zkIw5wq^K6j)Wg_@R_tKjrpn+0o<-s7|LQ?pYB4S#Q_XFRj>Isqzb6Tx&- zZ4A{k+g_2_WLFF_k)NOc zU6}s<;>6hNIuUq!ptc87@C&Ba6SU z*<1VJk`8v`hE(k)PW?PCWr={vxj#8M`5Dwpz9n{_ce}j)>cY{upNFEiYdbi*jGmW^ zdhUb%x@mo{c{Fuxc@uK$uz>T~eRoL%!LgxNzJ6RXMngX#yCubpQjl5HOICP*Wi&1q9Bf+M3{S&)y9m}fl(!hrj0}*xjB_y@szJ8E?+Xa zbxf+mr05?ev;X?Lckhn0g^&&5)F0jYA#SsCay-4B?7qRigG!xz$JCD*77!4q@N{dcYF0dA?707VfJ|at zLTj$Alkc-5kG>EvDVJ1JKB8(}n;w?@HFfk0G9j_5Q^OYcES6cLCnzwIp zt|wP)t*?IT>^s=`&xJ}x-6Gx(riVERDW=1F)w;O)7BH0y^y(PiP{;l@p&21qOYJ`$ zRc^KK?n~s=pS5z~`d(w7*xEB8F#BSn+YGLmFmHMO08Cs=z);&hO&B2kGl!Fh&Z%{6 z0;o*6}jWo^b@R(mYe6)rLEAV?8>b(WXWY^#3a%A!&1u9A=f3W=jzAlO8@EHZ4 T91;S>P6Rn>U`8%LoumE(JxmCy literal 0 HcmV?d00001 diff --git a/src/public/index.html b/src/public/index.html index 3d81fe16f..af98fbd4f 100644 --- a/src/public/index.html +++ b/src/public/index.html @@ -8,6 +8,6 @@ - Hello, World + \ No newline at end of file diff --git a/src/style/app.css b/src/style/app.css new file mode 100644 index 000000000..c0d850e33 --- /dev/null +++ b/src/style/app.css @@ -0,0 +1,22 @@ +/* styles in src/style directory are applied to the whole page */ +body { + background: #0147A7; + color: #fff; +} + +a { + color: #03A9F4; +} + +main { + padding: 1em; + font-family: Arial, Helvetica, sans-serif; + text-align: center; + margin-top: 50px; + display: block; +} + +footer { + text-align: center; + font-size: 0.8em; +} \ No newline at end of file From 325fe0a55ceb0fa4ca0dfb6a8fe3f6bd8e8ee66a Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Fri, 4 Mar 2016 11:38:13 +0100 Subject: [PATCH 40/67] move back to phantomjs launcher Fixes #17 --- karma.conf.js | 4 ++-- package.json | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/karma.conf.js b/karma.conf.js index d921cb97c..6c355f33e 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -30,8 +30,8 @@ module.exports = function karmaConfig (config) { }, browsers: [ - // Run tests using PhantomJS2 - 'PhantomJS2' + // Run tests using PhantomJS + 'PhantomJS' ], singleRun: true, diff --git a/package.json b/package.json index 7b0b29f2c..4d68a847d 100644 --- a/package.json +++ b/package.json @@ -38,12 +38,13 @@ "karma": "^0.13.14", "karma-coverage": "^0.5.3", "karma-jasmine": "^0.3.6", - "karma-phantomjs2-launcher": "^0.5.0", + "karma-phantomjs-launcher": "^1.0.0", "karma-sourcemap-loader": "^0.3.7", "karma-spec-reporter": "0.0.24", "karma-webpack": "^1.7.0", "node-libs-browser": "^1.0.0", "null-loader": "^0.1.1", + "phantomjs-prebuilt": "^2.1.4", "postcss-loader": "^0.8.0", "raw-loader": "^0.5.1", "rimraf": "^2.5.1", From cf9a7618030dccbd9de6261366eb1d25644318cd Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Sat, 9 Apr 2016 00:24:06 +0200 Subject: [PATCH 41/67] update devDependencies --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4d68a847d..3f6d28bc1 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "karma-jasmine": "^0.3.6", "karma-phantomjs-launcher": "^1.0.0", "karma-sourcemap-loader": "^0.3.7", - "karma-spec-reporter": "0.0.24", + "karma-spec-reporter": "0.0.26", "karma-webpack": "^1.7.0", "node-libs-browser": "^1.0.0", "null-loader": "^0.1.1", From 66560aee840c3ac6c2c10d2463386bc15ad65d39 Mon Sep 17 00:00:00 2001 From: Michal Stefanow Date: Mon, 13 Jun 2016 23:26:57 +0100 Subject: [PATCH 42/67] Adding a mobile viewport More info: https://developer.mozilla.org/en/docs/Mozilla/Mobile/Viewport_meta_tag --- src/public/index.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/public/index.html b/src/public/index.html index af98fbd4f..0e3f09713 100644 --- a/src/public/index.html +++ b/src/public/index.html @@ -4,10 +4,11 @@ Angular App + - \ No newline at end of file + From ca30a60005004d884bbfd9d1e8f0e9bd71f4e452 Mon Sep 17 00:00:00 2001 From: phra Date: Sat, 2 Jul 2016 02:37:13 +0200 Subject: [PATCH 43/67] update deps --- package.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 3f6d28bc1..8de6af090 100644 --- a/package.json +++ b/package.json @@ -28,16 +28,16 @@ "babel-core": "^6.2.1", "babel-loader": "^6.2.0", "babel-preset-es2015": "^6.1.18", - "copy-webpack-plugin": "^1.1.1", + "copy-webpack-plugin": "^3.0.1", "css-loader": "^0.23.0", "extract-text-webpack-plugin": "^1.0.1", - "file-loader": "^0.8.4", + "file-loader": "^0.9.0", "html-webpack-plugin": "^2.7.1", "isparta-instrumenter-loader": "^1.0.0", "jasmine-core": "^2.3.4", - "karma": "^0.13.14", - "karma-coverage": "^0.5.3", - "karma-jasmine": "^0.3.6", + "karma": "^1.1.0", + "karma-coverage": "^1.0.0", + "karma-jasmine": "^1.0.2", "karma-phantomjs-launcher": "^1.0.0", "karma-sourcemap-loader": "^0.3.7", "karma-spec-reporter": "0.0.26", @@ -45,7 +45,7 @@ "node-libs-browser": "^1.0.0", "null-loader": "^0.1.1", "phantomjs-prebuilt": "^2.1.4", - "postcss-loader": "^0.8.0", + "postcss-loader": "^0.9.1", "raw-loader": "^0.5.1", "rimraf": "^2.5.1", "style-loader": "^0.13.0", From b5871d05bc9ba3e1dd48486a7712b8aa0f016ffd Mon Sep 17 00:00:00 2001 From: phra Date: Thu, 14 Jul 2016 23:51:53 +0200 Subject: [PATCH 44/67] chore: fix autoprefixer, fixes preboot/angular-webpack#40 --- webpack.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index b443019f4..719efd162 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -100,7 +100,7 @@ module.exports = function makeWebpackConfig () { // // Reference: https://github.com/webpack/style-loader // Use style-loader in development. - loader: isTest ? 'null' : ExtractTextPlugin.extract('style', 'css?sourceMap!postcss') + loader: isTest ? 'null' : ExtractTextPlugin.extract('style-loader', 'css-loader?sourceMap!postcss-loader') }, { // ASSET LOADER // Reference: https://github.com/webpack/file-loader From be26132d4fd612fc5f25a6063a6b995e6015cd52 Mon Sep 17 00:00:00 2001 From: phra Date: Sat, 23 Jul 2016 19:41:17 +0200 Subject: [PATCH 45/67] switch to new isparta-loader, fixes #47 --- package.json | 2 +- webpack.config.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 8de6af090..bd8f95c75 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "extract-text-webpack-plugin": "^1.0.1", "file-loader": "^0.9.0", "html-webpack-plugin": "^2.7.1", - "isparta-instrumenter-loader": "^1.0.0", + "isparta-loader": "^2.0.0", "jasmine-core": "^2.3.4", "karma": "^1.1.0", "karma-coverage": "^1.0.0", diff --git a/webpack.config.js b/webpack.config.js index 719efd162..519c3bb30 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -130,7 +130,7 @@ module.exports = function makeWebpackConfig () { /node_modules/, /\.spec\.js$/ ], - loader: 'isparta-instrumenter' + loader: 'isparta-loader' }) } From 78eb561c524f18515d7f0975c7a8f4da46c30a54 Mon Sep 17 00:00:00 2001 From: phra Date: Sat, 23 Jul 2016 19:43:33 +0200 Subject: [PATCH 46/67] explicitly include all source code, fixes #8 --- src/tests.webpack.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tests.webpack.js b/src/tests.webpack.js index 953fc3fa5..4c52ac3d7 100644 --- a/src/tests.webpack.js +++ b/src/tests.webpack.js @@ -4,5 +4,7 @@ import 'angular'; import 'angular-mocks/angular-mocks'; -var testsContext = require.context(".", true, /.spec$/); -testsContext.keys().forEach(testsContext); \ No newline at end of file +const context = require.context('./app', true, /\.js$/); + +context.keys().forEach(context); + From 26229d602cbedbe8be19d36bc41f970787c75f5a Mon Sep 17 00:00:00 2001 From: Joel Larson Date: Fri, 16 Sep 2016 16:34:34 -0500 Subject: [PATCH 47/67] Replace deprecated isparta-loader with istanbul-instrumenter-loader --- package.json | 2 +- webpack.config.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index bd8f95c75..68ba32b2d 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "extract-text-webpack-plugin": "^1.0.1", "file-loader": "^0.9.0", "html-webpack-plugin": "^2.7.1", - "isparta-loader": "^2.0.0", + "istanbul-instrumenter-loader": "^1.0.0", "jasmine-core": "^2.3.4", "karma": "^1.1.0", "karma-coverage": "^1.0.0", diff --git a/webpack.config.js b/webpack.config.js index 519c3bb30..8e91d8192 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -130,7 +130,10 @@ module.exports = function makeWebpackConfig () { /node_modules/, /\.spec\.js$/ ], - loader: 'isparta-loader' + loader: 'istanbul-instrumenter', + query: { + esModules: true + } }) } From 997c3131b0ef28cd3ece6339520f2e37f44a2d22 Mon Sep 17 00:00:00 2001 From: Jairo S Date: Wed, 12 Oct 2016 17:00:48 -0300 Subject: [PATCH 48/67] fix 'npm run watch' docs --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 033ce50bf..cc225e88f 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ It will start a local server using `webpack-dev-server` which will watch, build ### Build files * single run: `npm run build` -* build files and watch: `npm run watch` +* build files and watch: `npm run server` ## Testing From c8d5735805a38951f2d43216f25c7c43c508b574 Mon Sep 17 00:00:00 2001 From: Francesco Soncina Date: Thu, 13 Oct 2016 11:37:26 +0200 Subject: [PATCH 49/67] change to npm start instead of npm run server --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cc225e88f..99e927ea9 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ It will start a local server using `webpack-dev-server` which will watch, build ### Build files * single run: `npm run build` -* build files and watch: `npm run server` +* build files and watch: `npm start` ## Testing From 6390925dfbb1072624c00aea7d4d53600d4c1387 Mon Sep 17 00:00:00 2001 From: hannes Date: Wed, 23 Nov 2016 17:38:51 +0800 Subject: [PATCH 50/67] Update istanbul-loader comment --- webpack.config.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index 8e91d8192..7fbeb57ac 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -119,10 +119,10 @@ module.exports = function makeWebpackConfig () { }] }; - // ISPARTA LOADER - // Reference: https://github.com/ColCh/isparta-instrumenter-loader - // Instrument JS files with Isparta for subsequent code coverage reporting - // Skips node_modules and files that end with .test.js + // ISTANBUL LOADER + // https://github.com/deepsweet/istanbul-instrumenter-loader + // Instrument JS files with istanbul-lib-instrument for subsequent code coverage reporting + // Skips node_modules and files that end with .test if (isTest) { config.module.preLoaders.push({ test: /\.js$/, From 7d03e09d65b8099660a47c7ad486731c12c9c18d Mon Sep 17 00:00:00 2001 From: Antti Pihlaja Date: Fri, 18 Nov 2016 21:50:40 +0200 Subject: [PATCH 51/67] Update dev dependencies - copy-webpack-plugin ^4.0.1 - node-libs-browser ^2.0.0 - postcss-loader ^1.1.1 --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 68ba32b2d..7f77b3be7 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "babel-core": "^6.2.1", "babel-loader": "^6.2.0", "babel-preset-es2015": "^6.1.18", - "copy-webpack-plugin": "^3.0.1", + "copy-webpack-plugin": "^4.0.1", "css-loader": "^0.23.0", "extract-text-webpack-plugin": "^1.0.1", "file-loader": "^0.9.0", @@ -42,10 +42,10 @@ "karma-sourcemap-loader": "^0.3.7", "karma-spec-reporter": "0.0.26", "karma-webpack": "^1.7.0", - "node-libs-browser": "^1.0.0", + "node-libs-browser": "^2.0.0", "null-loader": "^0.1.1", "phantomjs-prebuilt": "^2.1.4", - "postcss-loader": "^0.9.1", + "postcss-loader": "^1.1.1", "raw-loader": "^0.5.1", "rimraf": "^2.5.1", "style-loader": "^0.13.0", From 84c979d02e9b34288e1f0444371ac008075f35c3 Mon Sep 17 00:00:00 2001 From: Mike Erickson Date: Tue, 24 Jan 2017 16:44:05 -0800 Subject: [PATCH 52/67] 065 update to webpack 2 (#66) --- LICENSE | 2 +- README.md | 2 +- package.json | 18 ++++++++--------- postcss.config.js | 7 +++++++ webpack.config.js | 49 +++++++++++++++++++++++++++++++---------------- 5 files changed, 50 insertions(+), 28 deletions(-) create mode 100644 postcss.config.js diff --git a/LICENSE b/LICENSE index b06f77326..fad004c8a 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015-2016 Preboot team +Copyright (c) 2015-2017 Preboot team Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 99e927ea9..11b5850b0 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ A complete, yet simple, starter for Angular using Webpack. -This workflow serves as a starting point for building Angular 1.x applications using Webpack. Should be noted that apart from the pre-installed angular package, this workflow is pretty much generic. +This workflow serves as a starting point for building Angular 1.x applications using Webpack 2.x. Should be noted that apart from the pre-installed angular package, this workflow is pretty much generic. * Heavily commented webpack configuration with reasonable defaults. * ES6, and ES7 support with babel. diff --git a/package.json b/package.json index 7f77b3be7..ff1992462 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angular-webpack-workflow", - "version": "1.0.0", + "version": "1.1.0", "description": "A workflow for Angular made with Webpack", "scripts": { "build": "rimraf dist && webpack --bail --progress --profile", @@ -28,9 +28,9 @@ "babel-core": "^6.2.1", "babel-loader": "^6.2.0", "babel-preset-es2015": "^6.1.18", - "copy-webpack-plugin": "^4.0.1", - "css-loader": "^0.23.0", - "extract-text-webpack-plugin": "^1.0.1", + "copy-webpack-plugin": "4.0.1", + "css-loader": "0.26.1", + "extract-text-webpack-plugin": "2.0.0-beta.5", "file-loader": "^0.9.0", "html-webpack-plugin": "^2.7.1", "istanbul-instrumenter-loader": "^1.0.0", @@ -41,15 +41,15 @@ "karma-phantomjs-launcher": "^1.0.0", "karma-sourcemap-loader": "^0.3.7", "karma-spec-reporter": "0.0.26", - "karma-webpack": "^1.7.0", - "node-libs-browser": "^2.0.0", + "karma-webpack": "2.0.1", + "node-libs-browser": "2.0.0", "null-loader": "^0.1.1", "phantomjs-prebuilt": "^2.1.4", - "postcss-loader": "^1.1.1", + "postcss-loader": "1.2.2", "raw-loader": "^0.5.1", "rimraf": "^2.5.1", "style-loader": "^0.13.0", - "webpack": "^1.12.13", - "webpack-dev-server": "^1.14.1" + "webpack": "2.2.0", + "webpack-dev-server": "2.2.0" } } diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 000000000..3691590b4 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,7 @@ +module.exports = { + plugins: { + autoprefixer: { + browsers: ['last 2 versions'] + }, + }, +}; diff --git a/webpack.config.js b/webpack.config.js index 7fbeb57ac..dffe862f6 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -15,7 +15,7 @@ var ENV = process.env.npm_lifecycle_event; var isTest = ENV === 'test' || ENV === 'test-watch'; var isProd = ENV === 'build'; -module.exports = function makeWebpackConfig () { +module.exports = function makeWebpackConfig() { /** * Config * Reference: http://webpack.github.io/docs/configuration.html @@ -63,9 +63,11 @@ module.exports = function makeWebpackConfig () { */ if (isTest) { config.devtool = 'inline-source-map'; - } else if (isProd) { + } + else if (isProd) { config.devtool = 'source-map'; - } else { + } + else { config.devtool = 'eval-source-map'; } @@ -78,14 +80,13 @@ module.exports = function makeWebpackConfig () { // Initialize module config.module = { - preLoaders: [], - loaders: [{ + rules: [{ // JS LOADER // Reference: https://github.com/babel/babel-loader // Transpile .js files using babel-loader // Compiles ES6 and ES7 into ES5 code test: /\.js$/, - loader: 'babel', + loader: 'babel-loader', exclude: /node_modules/ }, { // CSS LOADER @@ -100,7 +101,14 @@ module.exports = function makeWebpackConfig () { // // Reference: https://github.com/webpack/style-loader // Use style-loader in development. - loader: isTest ? 'null' : ExtractTextPlugin.extract('style-loader', 'css-loader?sourceMap!postcss-loader') + + loader: isTest ? 'null' : ExtractTextPlugin.extract({ + fallbackLoader: 'style-loader', + loader: [ + {loader: 'css-loader', query: {sourceMap: true}}, + {loader: 'postcss-loader'} + ], + }) }, { // ASSET LOADER // Reference: https://github.com/webpack/file-loader @@ -109,13 +117,13 @@ module.exports = function makeWebpackConfig () { // Pass along the updated reference to your code // You can add here any file extension you want to get copied to your output test: /\.(png|jpg|jpeg|gif|svg|woff|woff2|ttf|eot)$/, - loader: 'file' + loader: 'file-loader' }, { // HTML LOADER // Reference: https://github.com/webpack/raw-loader // Allow loading html through js test: /\.html$/, - loader: 'raw' + loader: 'raw-loader' }] }; @@ -124,7 +132,8 @@ module.exports = function makeWebpackConfig () { // Instrument JS files with istanbul-lib-instrument for subsequent code coverage reporting // Skips node_modules and files that end with .test if (isTest) { - config.module.preLoaders.push({ + config.module.rules.push({ + enforce: 'pre', test: /\.js$/, exclude: [ /node_modules/, @@ -142,18 +151,24 @@ module.exports = function makeWebpackConfig () { * Reference: https://github.com/postcss/autoprefixer-core * Add vendor prefixes to your css */ - config.postcss = [ - autoprefixer({ - browsers: ['last 2 version'] - }) - ]; + // NOTE: This is now handled in the `postcss.config.js` + // webpack2 has some issues, making the config file necessary /** * Plugins * Reference: http://webpack.github.io/docs/configuration.html#plugins * List: http://webpack.github.io/docs/list-of-plugins.html */ - config.plugins = []; + config.plugins = [ + new webpack.LoaderOptionsPlugin({ + test: /\.scss$/i, + options: { + postcss: { + plugins: [autoprefixer] + } + } + }) + ]; // Skip rendering index.html in test mode if (!isTest) { @@ -168,7 +183,7 @@ module.exports = function makeWebpackConfig () { // Reference: https://github.com/webpack/extract-text-webpack-plugin // Extract css files // Disabled when in test mode or not in build mode - new ExtractTextPlugin('[name].[hash].css', {disable: !isProd}) + new ExtractTextPlugin({filename: 'css/[name].css', disable: !isProd, allChunks: true}) ) } From 29c56a78eb23262452ac7cbba4eb5c7c0fc438a8 Mon Sep 17 00:00:00 2001 From: phra Date: Tue, 31 Jan 2017 14:16:13 +0000 Subject: [PATCH 53/67] fix unit tests w/ webpack2, fixes #69 --- webpack.config.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index dffe862f6..cf55e2fab 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -29,7 +29,7 @@ module.exports = function makeWebpackConfig() { * Should be an empty object if it's generating a test build * Karma will set this when it's a test build */ - config.entry = isTest ? {} : { + config.entry = isTest ? void 0 : { app: './src/app/app.js' }; @@ -102,7 +102,7 @@ module.exports = function makeWebpackConfig() { // Reference: https://github.com/webpack/style-loader // Use style-loader in development. - loader: isTest ? 'null' : ExtractTextPlugin.extract({ + loader: isTest ? 'null-loader' : ExtractTextPlugin.extract({ fallbackLoader: 'style-loader', loader: [ {loader: 'css-loader', query: {sourceMap: true}}, @@ -139,7 +139,7 @@ module.exports = function makeWebpackConfig() { /node_modules/, /\.spec\.js$/ ], - loader: 'istanbul-instrumenter', + loader: 'istanbul-instrumenter-loader', query: { esModules: true } From 1331af782ea2670a452d89a80a0d10affc5c5697 Mon Sep 17 00:00:00 2001 From: Francesco Soncina Date: Tue, 21 Feb 2017 14:50:38 +0100 Subject: [PATCH 54/67] fix typo in comment, fixes #75 --- webpack.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index cf55e2fab..0178162d6 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -130,7 +130,7 @@ module.exports = function makeWebpackConfig() { // ISTANBUL LOADER // https://github.com/deepsweet/istanbul-instrumenter-loader // Instrument JS files with istanbul-lib-instrument for subsequent code coverage reporting - // Skips node_modules and files that end with .test + // Skips node_modules and files that end with .spec.js if (isTest) { config.module.rules.push({ enforce: 'pre', From de42174673755014d8e3d98b15dcfcdadf6484ba Mon Sep 17 00:00:00 2001 From: Aslan Date: Sun, 26 Mar 2017 19:39:10 +0400 Subject: [PATCH 55/67] fix repository url (#77) --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index ff1992462..c1c1569f6 100644 --- a/package.json +++ b/package.json @@ -11,14 +11,14 @@ }, "repository": { "type": "git", - "url": "https://github.com/Foxandxss/angular-webpack-workflow.git" + "url": "https://github.com/preboot/angularjs-webpack.git" }, "author": "Jesus Rodriguez", "license": "MIT", "bugs": { - "url": "https://github.com/Foxandxss/angular-webpack-workflow/issues" + "url": "https://github.com/preboot/angularjs-webpack/issues" }, - "homepage": "https://github.com/Foxandxss/angular-webpack-workflow", + "homepage": "https://github.com/preboot/angularjs-webpack", "dependencies": { "angular": "^1.5.0" }, From 15707e1d9e715566582db1c7a9d5fd0ecd09201c Mon Sep 17 00:00:00 2001 From: Eduardo Cancino Date: Fri, 31 Mar 2017 12:01:57 -0400 Subject: [PATCH 56/67] Fix repo name / url (#79) --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 11b5850b0..b5372f681 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# angular-webpack +# angularjs-webpack -[![Dependency Status](https://david-dm.org/preboot/angular-webpack/status.svg)](https://david-dm.org/preboot/angular-webpack#info=dependencies) [![devDependency Status](https://david-dm.org/preboot/angular-webpack/dev-status.svg)](https://david-dm.org/preboot/angular-webpack#info=devDependencies) +[![Dependency Status](https://david-dm.org/preboot/angularjs-webpack/status.svg)](https://david-dm.org/preboot/angular-webpack#info=dependencies) [![devDependency Status](https://david-dm.org/preboot/angularjs-webpack/dev-status.svg)](https://david-dm.org/preboot/angularjs-webpack#info=devDependencies) A complete, yet simple, starter for Angular using Webpack. @@ -23,7 +23,7 @@ This workflow serves as a starting point for building Angular 1.x applications u ```bash # clone our repo -$ git clone https://github.com/preboot/angular-webpack.git my-app +$ git clone https://github.com/preboot/angularjs-webpack.git my-app # change directory to your app $ cd my-app From e7186638f90e81e58419a2e2362efe8f3d869486 Mon Sep 17 00:00:00 2001 From: Frederik Prijck Date: Tue, 8 Aug 2017 09:38:38 +0200 Subject: [PATCH 57/67] update: Angular to AngularJS --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b5372f681..659693b04 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ [![Dependency Status](https://david-dm.org/preboot/angularjs-webpack/status.svg)](https://david-dm.org/preboot/angular-webpack#info=dependencies) [![devDependency Status](https://david-dm.org/preboot/angularjs-webpack/dev-status.svg)](https://david-dm.org/preboot/angularjs-webpack#info=devDependencies) -A complete, yet simple, starter for Angular using Webpack. +A complete, yet simple, starter for AngularJS using Webpack. -This workflow serves as a starting point for building Angular 1.x applications using Webpack 2.x. Should be noted that apart from the pre-installed angular package, this workflow is pretty much generic. +This workflow serves as a starting point for building AngularJS (1.x) applications using Webpack 2.x. Should be noted that apart from the pre-installed angular package, this workflow is pretty much generic. * Heavily commented webpack configuration with reasonable defaults. * ES6, and ES7 support with babel. From ab30818a501022b04e4862b65ee3dc70973d508f Mon Sep 17 00:00:00 2001 From: Damien Date: Tue, 23 Jan 2018 13:32:13 +0000 Subject: [PATCH 58/67] Fixes Webpack not wanting to load or show files --- webpack.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index 0178162d6..97d97655c 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -45,7 +45,7 @@ module.exports = function makeWebpackConfig() { // Output path from the view of the page // Uses webpack-dev-server in development - publicPath: isProd ? '/' : 'http://localhost:8080/', + publicPath: isProd ? '/' : 'http://0.0.0.0:8080/', // Filename for entry points // Only adds hash in build mode From 67fd6223111fd16d54a3e327a11ad86db73a8ec7 Mon Sep 17 00:00:00 2001 From: Damien Date: Tue, 23 Jan 2018 13:49:13 +0000 Subject: [PATCH 59/67] Configures Dev Server Host to match other config --- webpack.config.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index 97d97655c..e5a409f1c 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -217,7 +217,8 @@ module.exports = function makeWebpackConfig() { */ config.devServer = { contentBase: './src/public', - stats: 'minimal' + stats: 'minimal', + host: '0.0.0.0' }; return config; From 63236c61d526e1db795fa714aaea0a657a233691 Mon Sep 17 00:00:00 2001 From: Joseph Lin Date: Thu, 1 Feb 2018 17:10:59 -0500 Subject: [PATCH 60/67] [Update] License to current year --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index fad004c8a..43d69febc 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015-2017 Preboot team +Copyright (c) 2015-2018 Preboot team Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From ae1980adf941a3eac3043ec578b31f0b43fee145 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dras=CC=8Cko=20Kokic=CC=81?= Date: Sun, 6 May 2018 13:04:39 +0200 Subject: [PATCH 61/67] Update outdated dev dependencies --- package.json | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index c1c1569f6..a9deab621 100644 --- a/package.json +++ b/package.json @@ -23,33 +23,34 @@ "angular": "^1.5.0" }, "devDependencies": { + "ajv": "^6.4.0", "angular-mocks": "^1.5.0", - "autoprefixer": "^6.0.3", - "babel-core": "^6.2.1", - "babel-loader": "^6.2.0", + "autoprefixer": "^8.4.1", + "babel-core": "^6.26.3", + "babel-loader": "^7.1.4", "babel-preset-es2015": "^6.1.18", - "copy-webpack-plugin": "4.0.1", - "css-loader": "0.26.1", + "copy-webpack-plugin": "^4.5.1", + "css-loader": "^0.28.11", "extract-text-webpack-plugin": "2.0.0-beta.5", - "file-loader": "^0.9.0", - "html-webpack-plugin": "^2.7.1", - "istanbul-instrumenter-loader": "^1.0.0", - "jasmine-core": "^2.3.4", - "karma": "^1.1.0", + "file-loader": "^1.1.11", + "html-webpack-plugin": "^3.2.0", + "istanbul-instrumenter-loader": "^3.0.1", + "jasmine-core": "^3.1.0", + "karma": "^2.0.2", "karma-coverage": "^1.0.0", "karma-jasmine": "^1.0.2", "karma-phantomjs-launcher": "^1.0.0", "karma-sourcemap-loader": "^0.3.7", - "karma-spec-reporter": "0.0.26", - "karma-webpack": "2.0.1", - "node-libs-browser": "2.0.0", + "karma-spec-reporter": "^0.0.32", + "karma-webpack": "^3.0.0", + "node-libs-browser": "^2.1.0", "null-loader": "^0.1.1", "phantomjs-prebuilt": "^2.1.4", - "postcss-loader": "1.2.2", + "postcss-loader": "^2.1.5", "raw-loader": "^0.5.1", "rimraf": "^2.5.1", - "style-loader": "^0.13.0", - "webpack": "2.2.0", - "webpack-dev-server": "2.2.0" + "style-loader": "^0.21.0", + "webpack": "^2.7.0", + "webpack-dev-server": "^2.11.2" } } From 9a0a0f85ccb87554f8be8489371cf8aeb95dd584 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dras=CC=8Cko=20Kokic=CC=81?= Date: Thu, 24 May 2018 18:12:49 +0200 Subject: [PATCH 62/67] Upgrade dependencies to the latest stable angular.js --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index a9deab621..1cf62b05f 100644 --- a/package.json +++ b/package.json @@ -20,11 +20,11 @@ }, "homepage": "https://github.com/preboot/angularjs-webpack", "dependencies": { - "angular": "^1.5.0" + "angular": "^1.7.0" }, "devDependencies": { "ajv": "^6.4.0", - "angular-mocks": "^1.5.0", + "angular-mocks": "^1.7.0", "autoprefixer": "^8.4.1", "babel-core": "^6.26.3", "babel-loader": "^7.1.4", From 327cfd4531f471d3a212ce080363d30b8277597b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dras=CC=8Cko=20Kokic=CC=81?= Date: Sun, 6 May 2018 12:25:23 +0200 Subject: [PATCH 63/67] Add explicit browserslist config --- .browserslistrc | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .browserslistrc diff --git a/.browserslistrc b/.browserslistrc new file mode 100644 index 000000000..a834cb0d3 --- /dev/null +++ b/.browserslistrc @@ -0,0 +1,7 @@ +[production staging] +> 1% +ie 10 + +[development] +last 1 chrome version +last 1 firefox version From 70698214f5a852d86b02d76061a115bb652094fd Mon Sep 17 00:00:00 2001 From: Christian Oliff Date: Wed, 30 May 2018 22:02:50 +0900 Subject: [PATCH 64/67] Create .editorconfig --- .editorconfig | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..5850e3267 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,16 @@ +# editorconfig.org + +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 2 +indent_style = space +trim_trailing_whitespace = true + +[*.js] +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false From 19919e53b0c0730f0b5216687092c896649f0798 Mon Sep 17 00:00:00 2001 From: Erich Behrens Date: Tue, 12 Jun 2018 16:37:15 +0200 Subject: [PATCH 65/67] Fix publicPath for dev build --- webpack.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index e5a409f1c..587421ff4 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -45,7 +45,7 @@ module.exports = function makeWebpackConfig() { // Output path from the view of the page // Uses webpack-dev-server in development - publicPath: isProd ? '/' : 'http://0.0.0.0:8080/', + publicPath: '/', // Filename for entry points // Only adds hash in build mode From a4f1b4c92a0ffa17835f6112bc173ee165cff10e Mon Sep 17 00:00:00 2001 From: Peter Blazejewicz Date: Sat, 18 May 2019 23:46:49 +0200 Subject: [PATCH 66/67] Use CleanWebpackPlugin instead of rimraf This probably more common solution for cleaning dist directory when using only webpack Thanks! --- package.json | 4 ++-- webpack.config.js | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 1cf62b05f..6e68269bc 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "1.1.0", "description": "A workflow for Angular made with Webpack", "scripts": { - "build": "rimraf dist && webpack --bail --progress --profile", + "build": "webpack --bail --progress --profile", "server": "webpack-dev-server --history-api-fallback --inline --progress", "test": "karma start", "test-watch": "karma start --auto-watch --no-single-run", @@ -29,6 +29,7 @@ "babel-core": "^6.26.3", "babel-loader": "^7.1.4", "babel-preset-es2015": "^6.1.18", + "clean-webpack-plugin": "^2.0.2", "copy-webpack-plugin": "^4.5.1", "css-loader": "^0.28.11", "extract-text-webpack-plugin": "2.0.0-beta.5", @@ -48,7 +49,6 @@ "phantomjs-prebuilt": "^2.1.4", "postcss-loader": "^2.1.5", "raw-loader": "^0.5.1", - "rimraf": "^2.5.1", "style-loader": "^0.21.0", "webpack": "^2.7.0", "webpack-dev-server": "^2.11.2" diff --git a/webpack.config.js b/webpack.config.js index 587421ff4..8baa899aa 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -6,6 +6,7 @@ var autoprefixer = require('autoprefixer'); var HtmlWebpackPlugin = require('html-webpack-plugin'); var ExtractTextPlugin = require('extract-text-webpack-plugin'); var CopyWebpackPlugin = require('copy-webpack-plugin'); +var CleanWebpackPlugin = require('clean-webpack-plugin'); /** * Env @@ -160,6 +161,7 @@ module.exports = function makeWebpackConfig() { * List: http://webpack.github.io/docs/list-of-plugins.html */ config.plugins = [ + new CleanWebpackPlugin(), new webpack.LoaderOptionsPlugin({ test: /\.scss$/i, options: { From 533ec9d485864cd6d270d7b7421dd31f5906de8e Mon Sep 17 00:00:00 2001 From: Peter Blazejewicz Date: Sat, 18 May 2019 23:50:39 +0200 Subject: [PATCH 67/67] Remove deprecated dedupe plugin usage See: https://webpack.js.org/migrate/3/#dedupeplugin-has-been-removed Thanks! --- webpack.config.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index 587421ff4..53240cba8 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -194,10 +194,6 @@ module.exports = function makeWebpackConfig() { // Only emit files when there are no errors new webpack.NoErrorsPlugin(), - // Reference: http://webpack.github.io/docs/list-of-plugins.html#dedupeplugin - // Dedupe modules in the output - new webpack.optimize.DedupePlugin(), - // Reference: http://webpack.github.io/docs/list-of-plugins.html#uglifyjsplugin // Minify all javascript, switch loaders to minimizing mode new webpack.optimize.UglifyJsPlugin(),