Skip to content

Commit

Permalink
V8.0.4 - webpack + babel updates (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
westeezy authored Nov 14, 2022
1 parent 6e04f18 commit 713430f
Show file tree
Hide file tree
Showing 16 changed files with 96 additions and 36 deletions.
10 changes: 10 additions & 0 deletions .changeset/angry-pens-occur.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"@krakenjs/babel-config-grumbler": patch
"@krakenjs/eslint-config-grumbler": patch
"@krakenjs/grumbler-scripts": patch
"@krakenjs/karma-config-grumbler": patch
"@krakenjs/webpack-config-grumbler": patch
"@krakenjs/typescript-config-grumbler": patch
---

Consist filenames for babel configs. All files are `babelrc-*`
10 changes: 10 additions & 0 deletions .changeset/forty-chefs-draw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"@krakenjs/babel-config-grumbler": patch
"@krakenjs/eslint-config-grumbler": patch
"@krakenjs/grumbler-scripts": patch
"@krakenjs/karma-config-grumbler": patch
"@krakenjs/webpack-config-grumbler": patch
"@krakenjs/typescript-config-grumbler": patch
---

Update webpack dependencies to remove flow-bin and include webpack-dev-middleware
10 changes: 10 additions & 0 deletions .changeset/yellow-eyes-pump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"@krakenjs/babel-config-grumbler": patch
"@krakenjs/eslint-config-grumbler": patch
"@krakenjs/grumbler-scripts": patch
"@krakenjs/karma-config-grumbler": patch
"@krakenjs/webpack-config-grumbler": patch
"@krakenjs/typescript-config-grumbler": patch
---

Ensure webpack loaders are required from @krakenjs/webpack-config-grumbler as they will not be guaranteed to be hoisted in complex projects
66 changes: 48 additions & 18 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions packages/babel-config-grumbler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ npm install -D @krakenjs/babel-config-grumbler

```json
{
"extends": "@krakenjs/babel-config-grumbler/babel-node"
"extends": "@krakenjs/babel-config-grumbler/babelrc-node"
}
```

3b. For browser packages add the following contents to your `.babelrc`:

```json
{
"extends": "@krakenjs/babel-config-grumbler/babel-browser"
"extends": "@krakenjs/babel-config-grumbler/babelrc-browser"
}
```

Expand Down
2 changes: 1 addition & 1 deletion packages/babel-config-grumbler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@krakenjs/babel-config-grumbler",
"version": "8.0.3",
"description": "Babel scripts for grumbler modules",
"main": "babel-browser.js",
"main": "babelrc-browser.js",
"scripts": {
"lint": "eslint ."
},
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-grumbler/.babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "@krakenjs/babel-config-grumbler/babel-browser"
"extends": "@krakenjs/babel-config-grumbler/babelrc-browser"
}
2 changes: 1 addition & 1 deletion packages/grumbler-scripts/.babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "@krakenjs/babel-config-grumbler/babel-browser"
"extends": "@krakenjs/babel-config-grumbler/babelrc-browser"
}
2 changes: 1 addition & 1 deletion packages/grumbler-scripts/config/.babelrc-browser
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "extends": "@krakenjs/babel-config-grumbler/babel-browser" }
{ "extends": "@krakenjs/babel-config-grumbler/babelrc-browser" }
2 changes: 1 addition & 1 deletion packages/grumbler-scripts/config/.babelrc-node
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "extends": "@krakenjs/babel-config-grumbler/babel-node" }
{ "extends": "@krakenjs/babel-config-grumbler/babelrc-node" }
2 changes: 1 addition & 1 deletion packages/karma-config-grumbler/.babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "@krakenjs/babel-config-grumbler/babel-node"
"extends": "@krakenjs/babel-config-grumbler/babelrc-node"
}
2 changes: 1 addition & 1 deletion packages/webpack-config-grumbler/.babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "@krakenjs/babel-config-grumbler/babel-node"
"extends": "@krakenjs/babel-config-grumbler/babelrc-node"
}
16 changes: 8 additions & 8 deletions packages/webpack-config-grumbler/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ export function getWebpackConfig({
analyze = false,
dynamic = false,
optimize = env !== "local",
babelConfig = "@krakenjs/babel-config-grumbler/babel-browser",
babelConfig = "@krakenjs/babel-config-grumbler/babelrc-browser",
publicPath,
} = {}) {
const enableSourceMap = sourcemaps && web && !test;
Expand Down Expand Up @@ -383,23 +383,23 @@ export function getWebpackConfig({
rules.push({
test: /\.scss$/i,
use: [
"isomorphic-style-loader",
require.resolve("isomorphic-style-loader"),
{
loader: "css-loader",
loader: require.resolve("css-loader"),
options: {
importLoaders: 1,
},
},
"scoped-css-loader",
"sass-loader",
require.resolve("scoped-css-loader"),
require.resolve("sass-loader"),
],
});
}

if (enableCaching) {
rules.push({
test: /\.m?(j|t)sx?$/,
loader: "cache-loader",
loader: require.resolve("cache-loader"),
options: {
cacheDirectory: cacheDirs.cacheLoader,
},
Expand All @@ -409,7 +409,7 @@ export function getWebpackConfig({
rules.push({
test: /\.m?(j|t)sx?$/,
exclude: /(dist)/,
loader: "babel-loader",
loader: require.resolve("babel-loader"),
options: {
cacheDirectory: enableCaching && cacheDirs.babel,
extends: babelConfig,
Expand All @@ -418,7 +418,7 @@ export function getWebpackConfig({

rules.push({
test: /\.(html?|css|json|svg)$/,
loader: "raw-loader",
loader: require.resolve("raw-loader"),
});

const output = {
Expand Down
2 changes: 1 addition & 1 deletion packages/webpack-config-grumbler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
"cache-loader": "^4.1.0",
"circular-dependency-plugin": "^5.2.2",
"css-loader": "^5.2.7",
"flow-bin": "0.164.0",
"hard-source-webpack-plugin": "^0.13.1",
"imports": "^1.0.0",
"isomorphic-style-loader": "^5.3.2",
Expand All @@ -53,6 +52,7 @@
"webpack": "^4.44.1",
"webpack-bundle-analyzer": "^4.7.0",
"webpack-cli": "^4.10.0",
"webpack-dev-middleware": "^3.7.2",
"webpack-dev-server": "^4.11.1"
}
}

0 comments on commit 713430f

Please sign in to comment.