From 4cc61d79e236beded9453a5f722bad7abedf3681 Mon Sep 17 00:00:00 2001 From: SteveSandersonMS Date: Tue, 13 Dec 2016 12:57:06 +0000 Subject: [PATCH] Add json-loader to add webpack.config.js files. Helps with #507. --- templates/Angular2Spa/webpack.config.js | 3 ++- templates/AureliaSpa/package.json | 1 + templates/AureliaSpa/webpack.config.js | 3 ++- templates/KnockoutSpa/package.json | 1 + templates/KnockoutSpa/webpack.config.js | 3 ++- templates/ReactReduxSpa/webpack.config.js | 3 ++- templates/ReactSpa/package.json | 1 + templates/ReactSpa/webpack.config.js | 3 ++- 8 files changed, 13 insertions(+), 5 deletions(-) diff --git a/templates/Angular2Spa/webpack.config.js b/templates/Angular2Spa/webpack.config.js index bf85a7f..b54b08d 100644 --- a/templates/Angular2Spa/webpack.config.js +++ b/templates/Angular2Spa/webpack.config.js @@ -16,7 +16,8 @@ var sharedConfig = { { test: /\.ts$/, include: /ClientApp/, loaders: ['ts-loader?silent=true', 'angular2-template-loader'] }, { test: /\.html$/, loader: 'html-loader?minimize=false' }, { test: /\.css$/, loader: 'to-string-loader!css-loader' }, - { test: /\.(png|jpg|jpeg|gif|svg)$/, loader: 'url-loader', query: { limit: 25000 } } + { test: /\.(png|jpg|jpeg|gif|svg)$/, loader: 'url-loader', query: { limit: 25000 } }, + { test: /\.json$/, loader: 'json-loader' } ] } }; diff --git a/templates/AureliaSpa/package.json b/templates/AureliaSpa/package.json index 2346d4b..f68ccb1 100644 --- a/templates/AureliaSpa/package.json +++ b/templates/AureliaSpa/package.json @@ -33,6 +33,7 @@ "file-loader": "^0.9.0", "html-loader": "^0.4.4", "html-webpack-plugin": "^2.22.0", + "json-loader": "^0.5.4", "raw-loader": "^0.5.1", "style-loader": "^0.13.1", "to-string-loader": "^1.1.5", diff --git a/templates/AureliaSpa/webpack.config.js b/templates/AureliaSpa/webpack.config.js index dc3bdf6..a971f0c 100644 --- a/templates/AureliaSpa/webpack.config.js +++ b/templates/AureliaSpa/webpack.config.js @@ -17,7 +17,8 @@ module.exports = { { test: /\.ts$/, include: /ClientApp/, loader: 'ts-loader', query: { silent: true } }, { test: /\.html$/, loader: 'html-loader' }, { test: /\.css$/, loaders: [ 'style-loader', 'css-loader' ] }, - { test: /\.(png|woff|woff2|eot|ttf|svg)$/, loader: 'url-loader?limit=100000' } + { test: /\.(png|woff|woff2|eot|ttf|svg)$/, loader: 'url-loader?limit=100000' }, + { test: /\.json$/, loader: 'json-loader' } ] }, plugins: [ diff --git a/templates/KnockoutSpa/package.json b/templates/KnockoutSpa/package.json index 7c23198..ed36fd9 100644 --- a/templates/KnockoutSpa/package.json +++ b/templates/KnockoutSpa/package.json @@ -23,6 +23,7 @@ "history": "^4.3.0", "isomorphic-fetch": "^2.2.1", "jquery": "^2.2.1", + "json-loader": "^0.5.4", "knockout": "^3.4.0", "raw-loader": "^0.5.1", "style-loader": "^0.13.1", diff --git a/templates/KnockoutSpa/webpack.config.js b/templates/KnockoutSpa/webpack.config.js index 109a119..829a1de 100644 --- a/templates/KnockoutSpa/webpack.config.js +++ b/templates/KnockoutSpa/webpack.config.js @@ -17,7 +17,8 @@ module.exports = { { test: /\.ts$/, include: /ClientApp/, loader: 'ts-loader', query: { silent: true } }, { test: /\.html$/, loader: 'raw-loader' }, { test: /\.css$/, loader: isDevBuild ? 'style-loader!css-loader' : ExtractTextPlugin.extract(['css-loader']) }, - { test: /\.(png|jpg|jpeg|gif|svg)$/, loader: 'url-loader', query: { limit: 25000 } } + { test: /\.(png|jpg|jpeg|gif|svg)$/, loader: 'url-loader', query: { limit: 25000 } }, + { test: /\.json$/, loader: 'json-loader' } ] }, plugins: [ diff --git a/templates/ReactReduxSpa/webpack.config.js b/templates/ReactReduxSpa/webpack.config.js index d3a21af..d079e5c 100644 --- a/templates/ReactReduxSpa/webpack.config.js +++ b/templates/ReactReduxSpa/webpack.config.js @@ -14,7 +14,8 @@ var sharedConfig = () => ({ module: { loaders: [ { test: /\.tsx?$/, include: /ClientApp/, loader: 'babel-loader' }, - { test: /\.tsx?$/, include: /ClientApp/, loader: 'ts-loader', query: { silent: true } } + { test: /\.tsx?$/, include: /ClientApp/, loader: 'ts-loader', query: { silent: true } }, + { test: /\.json$/, loader: 'json-loader' } ] } }); diff --git a/templates/ReactSpa/package.json b/templates/ReactSpa/package.json index 79fc107..79b89c0 100644 --- a/templates/ReactSpa/package.json +++ b/templates/ReactSpa/package.json @@ -20,6 +20,7 @@ "file-loader": "^0.9.0", "isomorphic-fetch": "^2.2.1", "jquery": "^2.2.1", + "json-loader": "^0.5.4", "react": "^15.3.2", "react-dom": "^15.3.2", "react-router": "^2.8.1", diff --git a/templates/ReactSpa/webpack.config.js b/templates/ReactSpa/webpack.config.js index 3fa474c..6d6c593 100644 --- a/templates/ReactSpa/webpack.config.js +++ b/templates/ReactSpa/webpack.config.js @@ -18,7 +18,8 @@ module.exports = { { test: /\.ts(x?)$/, include: /ClientApp/, loader: 'babel-loader' }, { test: /\.tsx?$/, include: /ClientApp/, loader: 'ts-loader', query: { silent: true } }, { test: /\.css$/, loader: isDevBuild ? 'style-loader!css-loader' : ExtractTextPlugin.extract(['css-loader']) }, - { test: /\.(png|jpg|jpeg|gif|svg)$/, loader: 'url-loader', query: { limit: 25000 } } + { test: /\.(png|jpg|jpeg|gif|svg)$/, loader: 'url-loader', query: { limit: 25000 } }, + { test: /\.json$/, loader: 'json-loader' } ] }, plugins: [