Skip to content

Commit

Permalink
WIP rollup config for main thread
Browse files Browse the repository at this point in the history
  • Loading branch information
inukshuk committed Aug 7, 2020
1 parent 63b67a0 commit 67734e7
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 6 deletions.
9 changes: 7 additions & 2 deletions package.json
Expand Up @@ -26,7 +26,7 @@
"node": ">=10",
"npm": ">=6"
},
"main": "lib/browser/main.js",
"main": "lib/main.js",
"scripts": {
"clean": "rimraf coverage doc lib .nyc_output npm-debug.log",
"compile": "node scripts/compile",
Expand Down Expand Up @@ -64,7 +64,12 @@
"@babel/preset-react": "^7.10.4",
"@babel/register": "^7.10.5",
"@testing-library/react": "^10.4.8",
"@rollup/plugin-babel": "^5.1.0",
"@rollup/plugin-commonjs": "^14.0.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^8.4.0",
"babel-eslint": "^10.1.0",
"babel-plugin-istanbul": "^6.0.0",
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"chai-dom": "^1.8.2",
Expand All @@ -89,6 +94,7 @@
"react-dnd-test-backend-cjs": "^9.5.1",
"react-test-renderer": "^16.13.1",
"rimraf": "^3.0.2",
"rollup": "^2.23.0",
"shelljs": "^0.8.4",
"sinon": "^9.0.2",
"sinon-chai": "^3.5.0",
Expand All @@ -106,7 +112,6 @@
"@pixi/filter-adjustment": "^3.1.1",
"@pixi/unsafe-eval": "^5.3.3",
"@tweenjs/tween.js": "^18.6.0",
"babel-plugin-istanbul": "^6.0.0",
"bluebird": "^3.7.2",
"classnames": "^2.2.6",
"commander": "^6.0.0",
Expand Down
31 changes: 31 additions & 0 deletions rollup.config.js
@@ -0,0 +1,31 @@
import babel from '@rollup/plugin-babel'
import builtins from 'builtin-modules'
import commonjs from '@rollup/plugin-commonjs'
import json from '@rollup/plugin-json'
import resolve from '@rollup/plugin-node-resolve'

export default {
input: [
'./src/browser/main.js',
'./src/common/api.js'
],
output: {
dir: './lib',
format: 'cjs'
},
plugins: [
resolve(),
json(),
babel({ babelHelpers: 'bundled' }),
commonjs({
ignore: [
'pino-pretty',
'decompress'
]
})
],
external: [
'electron',
...builtins
]
}
1 change: 1 addition & 0 deletions scripts/build.js
Expand Up @@ -31,6 +31,7 @@ const IGNORE = [
/\.gitignore/,
/\.nvmrc/,
/\.nyc_output/,
/\.rollup\.config\.js/,
/\.sass-lint\.yml/,
/\.travis\.yml/,
/\.vimrc/,
Expand Down
4 changes: 1 addition & 3 deletions src/.babelrc.json
Expand Up @@ -4,8 +4,6 @@
],
"plugins": [
"@babel/plugin-syntax-class-properties",
"@babel/plugin-proposal-export-namespace-from",
"babel-plugin-dynamic-import-node",
"@babel/plugin-transform-modules-commonjs"
"@babel/plugin-proposal-export-namespace-from"
]
}
2 changes: 1 addition & 1 deletion src/browser/tropy.js
Expand Up @@ -38,7 +38,7 @@ import { Server as ApiServer } from './api'
import { WindowManager } from './wm'
import { addIdleObserver } from './idle'
import { migrate } from './migrate'
import act from './actions'
import * as act from './actions'

import {
FLASH, HISTORY, TAG, PROJECT, CONTEXT, LOCALE
Expand Down

0 comments on commit 67734e7

Please sign in to comment.