Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-azure-maps",
"version": "0.2.0",
"version": "0.2.1",
"description": "React Wrapper for Azure Maps",
"keywords": [
"react",
Expand All @@ -14,7 +14,6 @@
"react-azure-maps"
],
"source": "src/react-azure-maps.ts",
"main": "dist/react-azure-maps.umd.js",
"module": "dist/react-azure-maps.es5.js",
"typings": "dist/types/react-azure-maps.d.ts",
"files": [
Expand All @@ -30,7 +29,6 @@
"node": ">=8.0.0"
},
"scripts": {
"prepare": "install-peers",
"lint": "eslint --max-warnings 0 \"./src/**/*.{js,jsx,mjs,ts,tsx}\"",
"format": "prettier --check \"./src/**/*.{js,jsx,json,ts,tsx,css,scss,sass,mdx}\"",
"type-check": "tsc --noEmit",
Expand Down Expand Up @@ -97,10 +95,11 @@
"cross-env": "^7.0.2",
"eslint": "^7.14.0",
"husky": "^4.3.0",
"install-peers-cli": "^2.2.0",
"lint-staged": "^10.5.2",
"parcel-bundler": "1.12.3",
"prettier": "^2.2.0",
"react": "^16.10.2",
"react-dom": "^16.10.2",
"react-scripts": "4.0.1",
"rollup": "^2.33.3",
"rollup-plugin-copy": "^3.4.0",
Expand All @@ -121,5 +120,9 @@
"react": "^16.10.2",
"react-dom": "^16.10.2"
},
"dependencies": {}
"dependencies": {
"azure-maps-control": "2.0.32",
"guid-typescript": "^1.0.9",
"mapbox-gl": "^1.10.0"
}
}
31 changes: 9 additions & 22 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ import resolve from "@rollup/plugin-node-resolve";
import replace from "@rollup/plugin-replace";
import externals from "rollup-plugin-node-externals";
import pkg from "./package.json";
import postcss from 'rollup-plugin-postcss'
import postcss from "rollup-plugin-postcss";
import { terser } from "rollup-plugin-terser";

const ENV_PRODUCTION = "production";
const ENV_DEVELOPMENT = "development";
const env = process.env.NODE_ENV || ENV_PRODUCTION;
const production = env === ENV_PRODUCTION;

if (env !== ENV_DEVELOPMENT && env !== ENV_PRODUCTION) {
console.error(`
Expand All @@ -25,37 +24,25 @@ const extensions = [".js", ".jsx", ".ts", ".tsx"];
export default {
input: `src/${pkg.name}.ts`,
output: [
production && {
file: pkg.main,
format: "cjs",
name: 'azure-maps-react',
exports: "named",
sourcemap: true,
preserveModulesRoot: "src",
globals: {
"azure-maps-control": "atlas"
}
},
{
file: pkg.module,
format: "es",
exports: "named",
sourcemap: true,
preserveModulesRoot: "src",
}
},
].filter(Boolean),
watch: {
include: 'src/**'
include: "src/**",
},
plugins: [
externals({ peerDeps: true, deps: true, exclude:"azure-maps-control" }),
externals({ peerDeps: true, deps: true, exclude: "azure-maps-control" }),
replace({
"process.env.NODE_ENV": JSON.stringify(env),
"preventAssignment": true,
preventAssignment: true,
}),
json(),
postcss({
extensions: ['.css']
extensions: [".css"],
}),
resolve({
browser: true,
Expand All @@ -68,6 +55,6 @@ export default {
babelHelpers: "runtime",
include: ["./src/**/*"],
}),
terser()
]
}
terser(),
],
};
Loading