-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate @polar/plugin-layer-chooser to the new rollup setup
Also, import the styles from the package in all clients.
- Loading branch information
Showing
3 changed files
with
74 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,16 +5,32 @@ | |
"license": "EUPL-1.2", | ||
"type": "module", | ||
"author": "Dataport AöR <[email protected]>", | ||
"main": "src/index.ts", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"module": "dist/index.js", | ||
"exports": { | ||
".": { | ||
"import": "./dist/index.js", | ||
"require": "./dist/index.js" | ||
}, | ||
"./styles.css": { | ||
"import": "./dist/index.css", | ||
"require": "./dist/index.css" | ||
} | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/Dataport/polar.git", | ||
"directory": "packages/plugins/LayerChooser" | ||
}, | ||
"files": [ | ||
"src/**/*", | ||
"dist/**", | ||
"CHANGELOG.md" | ||
], | ||
"scripts": { | ||
"bundle": "tsc --declaration --emitDeclarationOnly && rollup -c", | ||
"preversion": "npm run bundle" | ||
}, | ||
"peerDependencies": { | ||
"@masterportal/masterportalapi": "2.8.0", | ||
"@repositoryname/vuex-generators": "^1.1.2", | ||
|
@@ -25,5 +41,8 @@ | |
"devDependencies": { | ||
"@polar/lib-custom-types": "^1.0.0", | ||
"@polar/lib-test-mount-parameters": "^1.0.0" | ||
}, | ||
"nx": { | ||
"includedScripts": ["bundle"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import commonjs from '@rollup/plugin-commonjs' | ||
import resolve from '@rollup/plugin-node-resolve' | ||
import scss from 'rollup-plugin-scss' | ||
import svg from 'rollup-plugin-svg' | ||
import terser from '@rollup/plugin-terser' | ||
import typescript from 'rollup-plugin-typescript2' | ||
import vue from 'rollup-plugin-vue' | ||
import { createFilter } from '@rollup/pluginutils' | ||
|
||
const external = createFilter( | ||
[ | ||
'@masterportal/masterportalapi/**', | ||
'@repositoryname/vuex-generators', | ||
'ol/**', | ||
'vue', | ||
'vuex', | ||
], | ||
null, | ||
{ resolve: false } | ||
) | ||
|
||
export default { | ||
input: 'src/index.ts', | ||
output: [ | ||
{ | ||
file: 'dist/index.js', | ||
name: '@polar/plugin-layer-chooser', | ||
format: 'es', | ||
sourcemap: 'inline', | ||
}, | ||
], | ||
external, | ||
plugins: [ | ||
vue({ | ||
defaultLang: { script: 'ts', style: 'scss' }, | ||
css: false, | ||
}), | ||
scss({ fileName: 'index.css', sourceMap: true }), | ||
// Types are not checked as typechecking does not work for vue-files with the current version, might be fixable with an upgrade of vue and vuex; see https://github.com/vuejs/vuex/pull/1121. | ||
typescript({ check: false }), | ||
commonjs(), | ||
resolve(), | ||
svg(), | ||
terser(), | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
{ | ||
"extends": "../../../tsconfig.json" | ||
"extends": "../../../tsconfig.json", | ||
"compilerOptions": { | ||
"outDir": "dist", | ||
}, | ||
"include": [ | ||
"src/**/*" | ||
] | ||
} |