Skip to content

Commit 34eb339

Browse files
authored
Merge pull request #5 from Patternslib/webpack5
maint(build): Upgrade to Webpack 5.
2 parents 4353c62 + e7be8a9 commit 34eb339

File tree

7 files changed

+61
-97
lines changed

7 files changed

+61
-97
lines changed

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
redactor/
2-
node_modules/
1+
.DS_Store
2+
.env
33
dist/
4+
node_modules/
45
stamp-yarn
6+
stats.json
7+
yarn-error.log
58
yarn.lock

.release-it.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require("@patternslib/patternslib/.release-it.js");

.release-it.json

Lines changed: 0 additions & 36 deletions
This file was deleted.

Makefile

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
-include .env
2+
export
3+
14
ESLINT ?= npx eslint
25
YARN ?= npx yarn
36

@@ -36,19 +39,25 @@ bundle: stamp-yarn
3639
.PHONY: release-major
3740
release-major: check
3841
npx release-it major --dry-run --ci && \
39-
npx release-it major --ci
42+
npx release-it major --ci && \
43+
npx release-it --github.release --github.update --no-github.draft --no-increment --no-git --no-npm --ci && \
44+
git checkout CHANGES.md
4045

4146

4247
.PHONY: release-minor
4348
release-minor: check
4449
npx release-it minor --dry-run --ci && \
45-
npx release-it minor --ci
50+
npx release-it minor --ci && \
51+
npx release-it --github.release --github.update --no-github.draft --no-increment --no-git --no-npm --ci && \
52+
git checkout CHANGES.md
4653

4754

4855
.PHONY: release-patch
4956
release-patch: check
5057
npx release-it patch --dry-run --ci && \
51-
npx release-it patch --ci
58+
npx release-it patch --ci && \
59+
npx release-it --github.release --github.update --no-github.draft --no-increment --no-git --no-npm --ci && \
60+
git checkout CHANGES.md
5261

5362

5463
.PHONY: serve

babel.config.js

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1 @@
1-
module.exports = {
2-
presets: [
3-
[
4-
"@babel/preset-env",
5-
{
6-
useBuiltIns: "entry",
7-
corejs: 3,
8-
},
9-
],
10-
],
11-
plugins: ["@babel/plugin-proposal-optional-chaining"],
12-
};
1+
module.exports = require("@patternslib/patternslib/babel.config.js");

package.json

Lines changed: 36 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -5,54 +5,50 @@
55
"license": "MIT",
66
"main": "./src/pat-redactor.js",
77
"dependencies": {
8-
"@patternslib/patternslib": "^5.1.2"
8+
"@patternslib/patternslib": "^6.0.1"
99
},
1010
"devDependencies": {
11-
"@babel/core": "^7.14.6",
12-
"@babel/eslint-parser": "^7.14.5",
13-
"@babel/plugin-proposal-optional-chaining": "^7.14.5",
14-
"@babel/preset-env": "^7.14.5",
15-
"@commitlint/cli": "^12.1.4",
16-
"@commitlint/config-conventional": "^12.1.4",
17-
"@release-it/conventional-changelog": "^3.0.1",
18-
"@testing-library/jest-dom": "^5.14.1",
19-
"babel-loader": "^8.2.2",
20-
"clean-webpack-plugin": "^3.0.0",
21-
"copy-webpack-plugin": "^6.4.1",
22-
"core-js": "3.19.0",
23-
"css-loader": "^5.2.6",
24-
"duplicate-package-checker-webpack-plugin": "^3.0.0",
25-
"eslint": "^7.28.0",
11+
"@babel/core": "^7.16.0",
12+
"@babel/eslint-parser": "^7.16.3",
13+
"@babel/plugin-proposal-optional-chaining": "^7.16.0",
14+
"@babel/preset-env": "^7.16.0",
15+
"@commitlint/cli": "^15.0.0",
16+
"@commitlint/config-conventional": "^15.0.0",
17+
"@release-it/conventional-changelog": "^3.3.0",
18+
"@testing-library/jest-dom": "^5.15.0",
19+
"babel-loader": "^8.2.3",
20+
"copy-webpack-plugin": "^10.0.0",
21+
"core-js": "3.19.1",
22+
"css-loader": "^6.5.0",
23+
"eslint": "^8.2.0",
2624
"eslint-config-prettier": "^8.3.0",
27-
"expose-loader": "^1.0.3",
28-
"file-loader": "^6.2.0",
29-
"husky": "^6.0.0",
25+
"expose-loader": "^3.0.0",
26+
"husky": "^7.0.4",
3027
"identity-obj-proxy": "^3.0.0",
31-
"imports-loader": "^1.2.0",
32-
"jest": "^27.0.4",
33-
"jest-watch-typeahead": "^0.6.4",
34-
"prettier": "^2.3.1",
35-
"raw-loader": "^4.0.1",
36-
"regenerator-runtime": "^0.13.5",
37-
"release-it": "^14.9.0",
38-
"sass": "^1.34.1",
39-
"sass-loader": "^10.1.1",
40-
"style-loader": "^2.0.0",
41-
"svg-inline-loader": "^0.8.2",
42-
"terser-webpack-plugin": "^4.2.3",
43-
"webpack": "^4.43.0",
44-
"webpack-bundle-analyzer": "^3.9.0",
45-
"webpack-cli": "^4.7.0",
46-
"webpack-dev-server": "^3.11.2",
28+
"imports-loader": "^3.1.0",
29+
"inspectpack": "^4.7.1",
30+
"jest": "^27.3.1",
31+
"jest-watch-typeahead": "^1.0.0",
32+
"prettier": "^2.4.1",
33+
"regenerator-runtime": "^0.13.9",
34+
"release-it": "^14.11.7",
35+
"sass": "^1.43.4",
36+
"sass-loader": "^12.3.0",
37+
"style-loader": "^3.3.0",
38+
"terser-webpack-plugin": "^5.2.5",
39+
"timezone-mock": "^1.2.2",
40+
"webpack": "^5.64.1",
41+
"webpack-bundle-analyzer": "^4.4.2",
42+
"webpack-cli": "^4.9.1",
43+
"webpack-dev-server": "^4.5.0",
4744
"webpack-modernizr-loader": "^5.0.0",
4845
"whybundled": "^2.0.0",
49-
"yarn": "^1.22.10"
46+
"yarn": "^1.22.17"
5047
},
5148
"scripts": {
52-
"start": "webpack serve --config webpack.config.js --mode=development",
53-
"watch": "webpack --config webpack.config.js --watch --mode=development",
54-
"build": "webpack --config webpack.config.js --mode=production",
55-
"build:stats": "webpack --config webpack.config.js --mode=development --json > stats.json",
49+
"start": "NODE_ENV=development webpack serve --config webpack.config.js",
50+
"build": "NODE_ENV=production webpack --config webpack.config.js",
51+
"build:stats": "NODE_ENV=production webpack --config webpack.config.js --json > stats.json",
5652
"test": "jest"
5753
},
5854
"browserslist": {

webpack.config.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ const path = require("path");
33
const patternslib_config = require("@patternslib/patternslib/webpack/webpack.config.js");
44

55
module.exports = async (env, argv) => {
6-
const config = patternslib_config(env, argv);
7-
8-
config.entry = {
9-
bundle: path.resolve(__dirname, "bundle-config.js"),
6+
let config = {
7+
entry: {
8+
bundle: path.resolve(__dirname, "bundle-config.js"),
9+
},
1010
};
11+
12+
config = patternslib_config(env, argv, config);
1113
config.output.path = path.resolve(__dirname, "dist/");
1214

1315
config.resolve.alias.redactor = path.resolve(__dirname, "../redactor");

0 commit comments

Comments
 (0)