Skip to content

Commit

Permalink
make rollup externals accept globs
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Schade authored and fschade committed Nov 25, 2020
1 parent d744896 commit 072042e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 6 deletions.
10 changes: 5 additions & 5 deletions tests/k6/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
## Requirements
- [K6](https://k6.io/)
- [YARN](https://yarnpkg.com/)
- [OCIS](https://github.com/owncloud/ocis)
* [K6](https://k6.io/)
* [YARN](https://yarnpkg.com/)
* [OCIS](https://github.com/owncloud/ocis)

## How to build
```
```console
$ yarn
$ yarn build
```

## How to run
```
```console
k6 run ./dist/TESTNAME.js
```
1 change: 1 addition & 0 deletions tests/k6/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"@rollup/plugin-commonjs": "^11.1.0",
"@rollup/plugin-json": "^4.0.3",
"@rollup/plugin-node-resolve": "^7.1.3",
"@rollup/pluginutils": "^4.1.0",
"@types/faker": "^5.1.4",
"@types/jest": "^25.2.1",
"@types/k6": "^0.28.2",
Expand Down
7 changes: 6 additions & 1 deletion tests/k6/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,18 @@ import babel from 'rollup-plugin-babel'
import { terser } from 'rollup-plugin-terser'
import multiInput from 'rollup-plugin-multi-input';
import path from 'path';
import utils from '@rollup/pluginutils';
import pkg from './package.json';

const extensions = ['.js', '.ts'];

export default [
{
input: ['src/test-*.ts'],
external: id => ['k6'].some(m => id.includes(m)),
external: utils.createFilter([
'k6/**',
...Object.keys(pkg.devDependencies),
], null, { resolve: false }),
output: [
{
dir: 'dist',
Expand Down
13 changes: 13 additions & 0 deletions tests/k6/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1267,6 +1267,14 @@
estree-walker "^1.0.1"
picomatch "^2.2.2"

"@rollup/pluginutils@^4.1.0":
version "4.1.0"
resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-4.1.0.tgz#0dcc61c780e39257554feb7f77207dceca13c838"
integrity sha512-TrBhfJkFxA+ER+ew2U2/fHbebhLT/l/2pRk0hfj9KusXUuRXd2v0R58AfaZK9VXDQ4TogOSEmICVrQAA3zFnHQ==
dependencies:
estree-walker "^2.0.1"
picomatch "^2.2.2"

"@sinonjs/commons@^1.7.0":
version "1.8.1"
resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.1.tgz#e7df00f98a203324f6dc7cc606cad9d4a8ab2217"
Expand Down Expand Up @@ -2619,6 +2627,11 @@ estree-walker@^1.0.1:
resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-1.0.1.tgz#31bc5d612c96b704106b477e6dd5d8aa138cb700"
integrity sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==

estree-walker@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.1.tgz#f8e030fb21cefa183b44b7ad516b747434e7a3e0"
integrity sha512-tF0hv+Yi2Ot1cwj9eYHtxC0jB9bmjacjQs6ZBTj82H8JwUywFuc+7E83NWfNMwHXZc11mjfFcVXPe9gEP4B8dg==

esutils@^2.0.2:
version "2.0.3"
resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64"
Expand Down

0 comments on commit 072042e

Please sign in to comment.