Skip to content

Commit 207aeaa

Browse files
fix: remove source maps and peer-install-cli (#89)
* fix: remove source maps and peer-install-cli * fix: add react as dependencies * fix: remove main umd and bump version Co-authored-by: psrednicki <patryk.srednicki@acaisoft.com>
1 parent 8ab9bc3 commit 207aeaa

File tree

3 files changed

+245
-58
lines changed

3 files changed

+245
-58
lines changed

package.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-azure-maps",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
44
"description": "React Wrapper for Azure Maps",
55
"keywords": [
66
"react",
@@ -14,7 +14,6 @@
1414
"react-azure-maps"
1515
],
1616
"source": "src/react-azure-maps.ts",
17-
"main": "dist/react-azure-maps.umd.js",
1817
"module": "dist/react-azure-maps.es5.js",
1918
"typings": "dist/types/react-azure-maps.d.ts",
2019
"files": [
@@ -30,7 +29,6 @@
3029
"node": ">=8.0.0"
3130
},
3231
"scripts": {
33-
"prepare": "install-peers",
3432
"lint": "eslint --max-warnings 0 \"./src/**/*.{js,jsx,mjs,ts,tsx}\"",
3533
"format": "prettier --check \"./src/**/*.{js,jsx,json,ts,tsx,css,scss,sass,mdx}\"",
3634
"type-check": "tsc --noEmit",
@@ -97,10 +95,11 @@
9795
"cross-env": "^7.0.2",
9896
"eslint": "^7.14.0",
9997
"husky": "^4.3.0",
100-
"install-peers-cli": "^2.2.0",
10198
"lint-staged": "^10.5.2",
10299
"parcel-bundler": "1.12.3",
103100
"prettier": "^2.2.0",
101+
"react": "^16.10.2",
102+
"react-dom": "^16.10.2",
104103
"react-scripts": "4.0.1",
105104
"rollup": "^2.33.3",
106105
"rollup-plugin-copy": "^3.4.0",
@@ -121,5 +120,9 @@
121120
"react": "^16.10.2",
122121
"react-dom": "^16.10.2"
123122
},
124-
"dependencies": {}
123+
"dependencies": {
124+
"azure-maps-control": "2.0.32",
125+
"guid-typescript": "^1.0.9",
126+
"mapbox-gl": "^1.10.0"
127+
}
125128
}

rollup.config.js

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@ import resolve from "@rollup/plugin-node-resolve";
55
import replace from "@rollup/plugin-replace";
66
import externals from "rollup-plugin-node-externals";
77
import pkg from "./package.json";
8-
import postcss from 'rollup-plugin-postcss'
8+
import postcss from "rollup-plugin-postcss";
99
import { terser } from "rollup-plugin-terser";
1010

1111
const ENV_PRODUCTION = "production";
1212
const ENV_DEVELOPMENT = "development";
1313
const env = process.env.NODE_ENV || ENV_PRODUCTION;
14-
const production = env === ENV_PRODUCTION;
1514

1615
if (env !== ENV_DEVELOPMENT && env !== ENV_PRODUCTION) {
1716
console.error(`
@@ -25,37 +24,25 @@ const extensions = [".js", ".jsx", ".ts", ".tsx"];
2524
export default {
2625
input: `src/${pkg.name}.ts`,
2726
output: [
28-
production && {
29-
file: pkg.main,
30-
format: "cjs",
31-
name: 'azure-maps-react',
32-
exports: "named",
33-
sourcemap: true,
34-
preserveModulesRoot: "src",
35-
globals: {
36-
"azure-maps-control": "atlas"
37-
}
38-
},
3927
{
4028
file: pkg.module,
4129
format: "es",
4230
exports: "named",
43-
sourcemap: true,
4431
preserveModulesRoot: "src",
45-
}
32+
},
4633
].filter(Boolean),
4734
watch: {
48-
include: 'src/**'
35+
include: "src/**",
4936
},
5037
plugins: [
51-
externals({ peerDeps: true, deps: true, exclude:"azure-maps-control" }),
38+
externals({ peerDeps: true, deps: true, exclude: "azure-maps-control" }),
5239
replace({
5340
"process.env.NODE_ENV": JSON.stringify(env),
54-
"preventAssignment": true,
41+
preventAssignment: true,
5542
}),
5643
json(),
5744
postcss({
58-
extensions: ['.css']
45+
extensions: [".css"],
5946
}),
6047
resolve({
6148
browser: true,
@@ -68,6 +55,6 @@ export default {
6855
babelHelpers: "runtime",
6956
include: ["./src/**/*"],
7057
}),
71-
terser()
72-
]
73-
}
58+
terser(),
59+
],
60+
};

0 commit comments

Comments
 (0)