Skip to content

Commit

Permalink
Migrate @polar/lib-invisible-style to the new rollup setup
Browse files Browse the repository at this point in the history
  • Loading branch information
dopenguin committed Feb 20, 2024
1 parent 23ef3b6 commit 82ed448
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 2 deletions.
22 changes: 21 additions & 1 deletion packages/lib/invisibleStyle/package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,36 @@
{
"name": "@polar/lib-invisible-style",
"version": "1.0.0",
"description": "Exports a style for vector layer features that results in invisibility. Plugins that work with feature visibility ought to use this package to keep them interoperable.",
"license": "EUPL-1.2",
"type": "module",
"author": "Dataport AöR <[email protected]>",
"main": "index.ts",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"module": "dist/index.js",
"exports": {
".": {
"import": "./dist/index.js",
"require": "./dist/index.js"
}
},
"files": [
"dist/**",
"CHANGELOG.md"
],
"scripts": {
"bundle": "tsc --declaration --emitDeclarationOnly && rollup -c",
"preversion": "npm run bundle"
},
"repository": {
"type": "git",
"url": "https://github.com/Dataport/polar.git",
"directory": "packages/lib/invisibleStyle"
},
"peerDependencies": {
"ol": "^7.1.0"
},
"nx": {
"includedScripts": ["bundle"]
}
}
21 changes: 21 additions & 0 deletions packages/lib/invisibleStyle/rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import commonjs from '@rollup/plugin-commonjs'
import resolve from '@rollup/plugin-node-resolve'
import terser from '@rollup/plugin-terser'
import typescript from 'rollup-plugin-typescript2'
import { createFilter } from '@rollup/pluginutils'

const external = createFilter(['ol/**'], null, { resolve: false })

export default {
input: 'index.ts',
output: [
{
file: 'dist/index.js',
name: '@polar/lib-invisible-style',
format: 'es',
sourcemap: 'inline',
},
],
external,
plugins: [typescript({ check: true }), commonjs(), resolve(), terser()],
}
6 changes: 5 additions & 1 deletion packages/lib/invisibleStyle/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{
"extends": "../../../tsconfig.json"
"extends": "../../../tsconfig.json",
"compilerOptions": {
"outDir": "dist",
},
"include": ["index.ts"]
}

0 comments on commit 82ed448

Please sign in to comment.