Skip to content

Commit

Permalink
feat: Make dependencies external
Browse files Browse the repository at this point in the history
Signed-off-by: Ferdinand Thiessen <[email protected]>
  • Loading branch information
susnux committed Feb 14, 2023
1 parent d0a7523 commit 804bcc8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
File renamed without changes.
13 changes: 12 additions & 1 deletion rollup.config.mjs → rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,23 @@ import resolve from '@rollup/plugin-node-resolve'
import typescript from '@rollup/plugin-typescript'

import postcss from 'rollup-plugin-postcss'
import postcssurl from 'postcss-url';
import postcssurl from 'postcss-url'

import BabelLoaderExcludeNodeModulesExcept from 'babel-loader-exclude-node-modules-except'

import { DEFAULT_EXTENSIONS } from '@babel/core'
import { readFile } from 'fs/promises'

const extensions = [...DEFAULT_EXTENSIONS, '.ts', '.tsx']

const packageJson = JSON.parse(
await readFile(
new URL('./package.json', import.meta.url)
)
)

const externals = [...Object.keys(packageJson?.dependencies || {}), ...Object.keys(packageJson?.peerDependencies || {})]

const translations = fs
.readdirSync('./l10n')
.filter(name => name !== 'messages.pot' && name.endsWith('.pot'))
Expand Down Expand Up @@ -46,6 +56,7 @@ export default [
sourcemap: true
}
],
external: externals,
plugins: [
resolve({ extensions }),
typescript(),
Expand Down

0 comments on commit 804bcc8

Please sign in to comment.