From 26229d602cbedbe8be19d36bc41f970787c75f5a Mon Sep 17 00:00:00 2001 From: Joel Larson Date: Fri, 16 Sep 2016 16:34:34 -0500 Subject: [PATCH 01/21] 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 02/21] 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 03/21] 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 04/21] 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 05/21] 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 06/21] 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 07/21] 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 08/21] 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 09/21] 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 10/21] 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 11/21] 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 12/21] 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 13/21] 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 14/21] [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 15/21] 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 16/21] 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 17/21] 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 18/21] 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 19/21] 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 20/21] 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 21/21] 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(),