-
-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* use rollup esbuild plugin * bundle sentry separately * bundle rita separately * remove log * update configs * remove leftover log * move build scripts to typescript * replace ts-node with esbuild-runner * replace ts-jest * convert install-compiler to typescript * remove obsolete babel config
- Loading branch information
Showing
10 changed files
with
311 additions
and
244 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
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,51 @@ | ||
import { Plugin, RollupOptions } from 'rollup' | ||
// TODO: Replace this when "rollup-plugin-esbuild" fixes their sourcemap issues. | ||
import esbuild, { Options } from 'rollup-plugin-esbuild-transform' | ||
import { nodeResolve } from '@rollup/plugin-node-resolve' | ||
import commonjs from '@rollup/plugin-commonjs' | ||
|
||
const env = process.env.NODE_ENV | ||
const isProduction = env === 'production' | ||
|
||
const sharedOptions: Options = { | ||
minify: isProduction, | ||
target: 'es2016', | ||
define: { | ||
// Avoids issues with the Node-specific variable `process`. | ||
'process.env.NODE_ENV': JSON.stringify(env) | ||
} | ||
} | ||
|
||
const plugins: Plugin[] = [ | ||
esbuild([ | ||
{ loader: 'json', ...sharedOptions }, | ||
{ loader: 'ts', ...sharedOptions } | ||
]), | ||
nodeResolve({ browser: true }), | ||
commonjs({ extensions: ['.js', '.json'] }) | ||
] | ||
|
||
export const configs: RollupOptions[] = [ | ||
{ | ||
input: 'src/main.ts', | ||
plugins, | ||
external: ['@lib'], | ||
output: { format: 'iife', file: 'src/init.js', globals: { '@lib': 'lib' }, sourcemap: 'inline' } | ||
}, | ||
{ | ||
input: 'lib/index.ts', | ||
external: ['rita'], | ||
plugins, | ||
output: { format: 'iife', file: './gh-pages/main.js', globals: { rita: 'RiTa' }, name: 'lib', sourcemap: true } | ||
}, | ||
{ | ||
input: 'lib/sentry.ts', | ||
plugins, | ||
output: { format: 'iife', file: './gh-pages/sentry.js', sourcemap: false } | ||
}, | ||
{ | ||
input: 'rita', | ||
plugins, | ||
output: { format: 'iife', file: './gh-pages/rita.js', name: 'RiTa', sourcemap: 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
Oops, something went wrong.