Skip to content

Commit 9b0404f

Browse files
committed
build: configure UMD builds
1 parent 0bb82ea commit 9b0404f

File tree

4 files changed

+44
-22
lines changed

4 files changed

+44
-22
lines changed

.npmignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ src/
1818
.prettierrc.js
1919
babel.config.js
2020
commitlint.config.js
21-
dot-notation.png
22-
cypress.json
2321
jest.config.js
22+
mapper-js.png
2423
release.config.js
2524
rollup.config.js
2625
tsconfig.*

configurations/rollup/config.js

Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,40 @@ const pkg = require('../../package.json');
66
const pkgName = 'mapper';
77
const global = [...Object.keys(pkg.dependencies)];
88

9-
module.exports = {
10-
input: './lib/index.js',
11-
output: {
12-
file: `lib/${pkgName}.min.js`,
13-
format: 'es',
14-
name: pkgName,
15-
sourcemap: true,
16-
interop: false,
9+
module.exports = [
10+
{
11+
input: './lib/index.js',
12+
output: {
13+
file: `lib/${pkgName}.min.js`,
14+
format: 'umd',
15+
name: pkgName,
16+
sourcemap: true,
17+
interop: false,
18+
},
19+
plugins: [
20+
resolve({
21+
mainFields: ['module', 'main'],
22+
}),
23+
commonjs(),
24+
terser(),
25+
],
1726
},
18-
plugins: [
19-
resolve({
20-
mainFields: ['module', 'main'],
21-
}),
22-
commonjs(),
23-
terser(),
24-
],
25-
external: global,
26-
};
27+
{
28+
input: './lib/index.js',
29+
output: {
30+
file: `lib/${pkgName}.clean.min.js`,
31+
format: 'umd',
32+
name: pkgName,
33+
sourcemap: true,
34+
interop: false,
35+
},
36+
plugins: [
37+
resolve({
38+
mainFields: ['module', 'main'],
39+
}),
40+
commonjs(),
41+
terser(),
42+
],
43+
external: global,
44+
}
45+
];

configurations/semantic-release/config.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,18 @@ module.exports = {
1818
[
1919
'@semantic-release/github',
2020
{
21-
assets: [{ path: 'release/*.tgz' }, { path: `lib/dot.min.js*(.map)`, label: 'UMD build minified' }],
21+
assets: [
22+
{ path: 'release/*.tgz' },
23+
{ path: `lib/mapper.min.js*(.map)`, label: 'UMD build minified' },
24+
{ path: `lib/mapper.pure.min.js*(.map)`, label: 'UMD build minified - without dependencies' }
25+
],
2226
},
2327
],
2428
[
2529
'@semantic-release/git',
2630
{
2731
message: 'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}',
28-
assets: ['CHANGELOG.md', 'package.json', 'yarn.lock', 'npm-shrinkwrap.json']
32+
assets: ['CHANGELOG.md', 'AUTHORS.md', 'package.json', 'yarn.lock', 'npm-shrinkwrap.json']
2933
},
3034
],
3135
],

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cookbook/mapper-js",
3-
"version": "1.0.0",
3+
"version": "2.0.0",
44
"description": "Fast, reliable and intuitive object mapping.",
55
"main": "lib/index.js",
66
"types": "lib/index.d.ts",

0 commit comments

Comments
 (0)