Skip to content

Commit

Permalink
use correct webpack convention (#71)
Browse files Browse the repository at this point in the history
* update to new webpack convention
* publish new version
  • Loading branch information
stoikerty authored Sep 25, 2018
1 parent eabe2ea commit c3bfbfb
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/packages/dev-toolkit/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/packages/dev-toolkit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dev-toolkit",
"version": "7.1.0",
"version": "7.1.1",
"description": "Universal Development Toolkit for React Veterans",
"main": "dev-toolkit.js",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion src/templates/minimal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"dependencies": {
"babel-preset-dev-toolkit": "^1.0.5",
"cross-env": "^5.1.5",
"dev-toolkit": "^7.1.0",
"dev-toolkit": "^7.1.1",
"express": "^4.16.3",
"react": "^16.3.2",
"react-dom": "^16.3.2"
Expand Down
2 changes: 1 addition & 1 deletion src/templates/serverless/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"babel-preset-dev-toolkit": "^1.0.5",
"clear-module": "^2.1.0",
"cross-env": "^5.1.5",
"dev-toolkit": "^7.1.0",
"dev-toolkit": "^7.1.1",
"express": "^4.16.3",
"express-handlebars": "^3.0.0",
"react": "^16.3.2",
Expand Down
9 changes: 6 additions & 3 deletions src/templates/standard/dev-toolkit.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ module.exports = {
sharedEnvs: ['MY_CUSTOM_ENV'],
},

// Use custom webpack configuration here
// Use custom webpack configuration here. Available `options` for each function:
// { projectRoot, creatingBuild, namingConvention, assetsPath, publicPath, babelrc }
webpack: {
loaders: function(options) {
// Extend existing webpack rules (formerly called loaders)
rules: function rules(options) {
return [];
},
plugins: function(options) {
// Extend existing webpack plugins
plugins: function plugins(options) {
return [];
},
},
Expand Down
2 changes: 1 addition & 1 deletion src/templates/standard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"babel-preset-dev-toolkit": "^1.0.5",
"better-npm-run": "^0.1.0",
"clear-module": "^2.1.0",
"dev-toolkit": "^7.1.0",
"dev-toolkit": "^7.1.1",
"express": "^4.16.3",
"express-handlebars": "^3.0.0",
"react": "^16.3.2",
Expand Down
9 changes: 6 additions & 3 deletions src/templates/with-eslint/dev-toolkit.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ module.exports = {
sharedEnvs: ['MY_CUSTOM_ENV'],
},

// Use custom webpack configuration here
// Use custom webpack configuration here. Available `options` for each function:
// { projectRoot, creatingBuild, namingConvention, assetsPath, publicPath, babelrc }
webpack: {
loaders: function(options) {
// Extend existing webpack rules (formerly called loaders)
rules: function rules(options) {
return [];
},
plugins: function(options) {
// Extend existing webpack plugins
plugins: function plugins(options) {
return [];
},
},
Expand Down
2 changes: 1 addition & 1 deletion src/templates/with-eslint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"babel-preset-dev-toolkit": "^1.0.5",
"better-npm-run": "^0.1.0",
"clear-module": "^2.1.0",
"dev-toolkit": "^7.1.0",
"dev-toolkit": "^7.1.1",
"express": "^4.16.3",
"express-handlebars": "^3.0.0",
"react": "^16.3.2",
Expand Down
9 changes: 6 additions & 3 deletions src/templates/with-sass/dev-toolkit.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ module.exports = {
cssChunkNaming: cssChunkNaming,
includePaths: includePaths,

// Exports for dev-toolkit to pick up
// Use custom webpack configuration here. Available `options` for each function:
// { projectRoot, creatingBuild, namingConvention, assetsPath, publicPath, babelrc }
webpack: {
rules: function(options) {
// Extend existing webpack rules (formerly called loaders)
rules: function rules(options) {
return [
{
test: /\.scss$/,
Expand All @@ -46,8 +48,9 @@ module.exports = {
];
},

// Extend existing webpack plugins
// Generate a single css-file on build from all extracted files
plugins: function(options) {
plugins: function plugins(options) {
const cssFileToGenerate = options.namingConvention + '.css';
return options.creatingBuild
? [new ExtractTextPlugin({ filename: cssFileToGenerate, allChunks: true })]
Expand Down
2 changes: 1 addition & 1 deletion src/templates/with-sass/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"cross-env": "^5.1.5",
"css-loader": "^0.28.11",
"css-modules-require-hook": "^4.2.3",
"dev-toolkit": "^7.1.0",
"dev-toolkit": "^7.1.1",
"express": "^4.16.3",
"express-handlebars": "^3.0.0",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
Expand Down

0 comments on commit c3bfbfb

Please sign in to comment.