Skip to content

Commit 928d054

Browse files
committed
bump: 2.2.1
fix: 2.2.0
1 parent 81ad8ec commit 928d054

File tree

3 files changed

+52
-685
lines changed

3 files changed

+52
-685
lines changed

package.json

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
{
22
"name": "multiform-validator",
3-
"version": "2.2.0",
3+
"version": "2.2.1",
44
"description": "Javascript library made to validate, several form fields, such as: email, images, phone, password, cpf etc.",
5-
"main": "./dist/cjs/index.js",
5+
"main": "./dist/cjs/index.cjs",
6+
"module": "./dist/esm/index.mjs",
67
"types": "./types/index.d.ts",
7-
"module": "./dist/esm/index.js",
8+
"exports": {
9+
".": {
10+
"import": "./dist/esm/index.mjs",
11+
"require": "./dist/cjs/index.cjs",
12+
"types": "./types/index.d.ts"
13+
}
14+
},
815
"unpkg": "./dist/cjs/index.js",
916
"scripts": {
1017
"test": "jest --coverage",
@@ -13,7 +20,7 @@
1320
"build:types": "tsc -p tsconfig.types.json",
1421
"build:src": "npx tsup index.ts --format esm --legacy-output",
1522
"build:browser": "webpack",
16-
"build": "yarn build:types && yarn build:src && yarn build:browser",
23+
"build": "yarn build:types && yarn build:browser",
1724
"lint": "eslint . --ext .ts",
1825
"prettier": "prettier --write .",
1926
"pr-check": "yarn prettier && yarn lint && yarn build && yarn test"
@@ -58,7 +65,6 @@
5865
"Breno A"
5966
],
6067
"devDependencies": {
61-
"@swc/core": "^1.7.2",
6268
"@types/jest": "^29.5.12",
6369
"@types/mocha": "^10.0.6",
6470
"@types/node": "^20.5.1",
@@ -72,7 +78,6 @@
7278
"ts-jest": "^29.1.1",
7379
"ts-loader": "^9.5.1",
7480
"ts-node": "^10.9.2",
75-
"tsup": "^8.2.3",
7681
"typescript": "^5.4.2",
7782
"webpack": "^5.91.0",
7883
"webpack-cli": "^5.1.4"

webpack.config.js

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const commonjsWebpackConfig = {
44
mode: "production", // production mode
55
entry: "./index.ts", // entry point of your application
66
output: {
7-
filename: "cjs/index.js", // output file name
7+
filename: "cjs/index.cjs", // output file name
88
path: path.resolve(__dirname, "dist"), // output folder
99
libraryTarget: "umd", // this allows your module to be used via require() and as a global
1010
globalObject: "this", // this ensures that 'this' is 'window' in a browser environment
@@ -23,4 +23,29 @@ const commonjsWebpackConfig = {
2323
},
2424
};
2525

26-
module.exports = [commonjsWebpackConfig]; // export the webpack config
26+
const moduleWebpackConfig = {
27+
mode: "production", // production mode
28+
entry: "./index.ts", // entry point of your application
29+
output: {
30+
filename: "esm/index.mjs", // output file name
31+
path: path.resolve(__dirname, "dist"), // output folder
32+
libraryTarget: "module", // this allows your module to be used via import
33+
},
34+
experiments: {
35+
outputModule: true,
36+
},
37+
module: {
38+
rules: [
39+
{
40+
test: /\.ts?$/,
41+
use: "ts-loader",
42+
exclude: /node_modules/,
43+
},
44+
],
45+
},
46+
resolve: {
47+
extensions: [".ts"],
48+
},
49+
};
50+
51+
module.exports = [commonjsWebpackConfig, moduleWebpackConfig]; // export the webpack config

0 commit comments

Comments
 (0)