-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1322 from finos/rollup-exports
Export inline `@finos/perspective` by default, and simplify some package `dist` with rollup
- Loading branch information
Showing
21 changed files
with
960 additions
and
184 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
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
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
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
15 changes: 0 additions & 15 deletions
15
packages/perspective-viewer-datagrid/src/config/cjs.config.js
This file was deleted.
Oops, something went wrong.
41 changes: 41 additions & 0 deletions
41
packages/perspective-viewer-datagrid/src/config/rollup.config.js
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,41 @@ | ||
import babel from "@rollup/plugin-babel"; | ||
import filesize from "rollup-plugin-filesize"; | ||
import postcss from "rollup-plugin-postcss"; | ||
import sourcemaps from "rollup-plugin-sourcemaps"; | ||
import {nodeResolve} from "@rollup/plugin-node-resolve"; | ||
import path from "path"; | ||
|
||
const PROJECT_PATH = path.resolve(__dirname, "..", ".."); | ||
|
||
export default () => { | ||
return [ | ||
{ | ||
input: "src/js/plugin.js", | ||
external: id => { | ||
let include = id.startsWith(".") || require.resolve(id).indexOf(PROJECT_PATH) === 0 || id.endsWith(".less"); | ||
return !include; | ||
}, | ||
output: { | ||
sourcemap: true, | ||
file: "dist/esm/perspective-viewer-datagrid.js" | ||
}, | ||
plugins: [ | ||
nodeResolve(), | ||
babel({ | ||
exclude: "node_modules/**", | ||
babelHelpers: "bundled" | ||
}), | ||
filesize(), | ||
postcss({ | ||
inject: false, | ||
sourceMap: true, | ||
minimize: {preset: "lite"} | ||
}), | ||
sourcemaps() | ||
].filter(x => x), | ||
watch: { | ||
clearScreen: false | ||
} | ||
} | ||
]; | ||
}; |
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
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
4 changes: 2 additions & 2 deletions
4
packages/perspective-viewer-datagrid/src/less/regular_table.less
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
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
This file was deleted.
Oops, something went wrong.
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,66 @@ | ||
import babel from "@rollup/plugin-babel"; | ||
import {string} from "rollup-plugin-string"; | ||
import filesize from "rollup-plugin-filesize"; | ||
import postcss from "rollup-plugin-postcss"; | ||
import sourcemaps from "rollup-plugin-sourcemaps"; | ||
import {nodeResolve} from "@rollup/plugin-node-resolve"; | ||
import path from "path"; | ||
import fs from "fs"; | ||
|
||
const THEMES = fs.readdirSync(path.resolve(__dirname, "..", "themes")); | ||
const PROJECT_PATH = path.resolve(__dirname, "..", ".."); | ||
|
||
export default () => { | ||
function reducer(key, val) { | ||
return { | ||
input: `${val}`, | ||
output: { | ||
dir: "dist/umd" | ||
}, | ||
plugins: [ | ||
postcss({ | ||
inject: false, | ||
extract: path.resolve(`dist/umd/${key}.css`), | ||
sourceMap: true, | ||
minimize: {preset: "lite"} | ||
}), | ||
sourcemaps() | ||
] | ||
}; | ||
} | ||
|
||
return [ | ||
...THEMES.map(theme => reducer(theme.replace(".less", ""), path.resolve(__dirname, "..", "themes", theme))), | ||
{ | ||
input: "src/js/viewer.js", | ||
external: id => { | ||
let include = id.startsWith(".") || require.resolve(id).indexOf(PROJECT_PATH) === 0 || id.endsWith(".css"); | ||
return !include; | ||
}, | ||
output: { | ||
sourcemap: true, | ||
dir: "dist/esm/" | ||
}, | ||
plugins: [ | ||
nodeResolve(), | ||
babel({ | ||
exclude: "node_modules/**", | ||
babelHelpers: "bundled" | ||
}), | ||
string({ | ||
include: "**/*.html" | ||
}), | ||
filesize(), | ||
postcss({ | ||
inject: false, | ||
sourceMap: true, | ||
minimize: {preset: "lite"} | ||
}), | ||
sourcemaps() | ||
].filter(x => x), | ||
watch: { | ||
clearScreen: false | ||
} | ||
} | ||
]; | ||
}; |
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
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
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
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
Oops, something went wrong.