Skip to content

Commit

Permalink
fix: remove external deps
Browse files Browse the repository at this point in the history
  • Loading branch information
pedronauck committed Aug 4, 2018
1 parent 01e62a8 commit 470bdd3
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/docz-core/src/utils/repo-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as paths from '../config/paths'
export const repoInfo = (src: string | './'): string | null => {
try {
const project = path.parse(findup.sync('.git')).dir
const root = path.join(paths.root, src);
const root = path.join(paths.root, src)
const relative = path.relative(project, root)
const tree = path.join('/tree/master', relative)
const pkg = fs.readJsonSync(paths.appPackageJson)
Expand Down
19 changes: 17 additions & 2 deletions packages/docz-theme-default/librc.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
const svg = require('rollup-plugin-svg')
const pkg = require('./package.json')

const external = Object.keys(pkg.dependencies).concat([
const internal = [
'facepaint',
'match-sorter',
'react-breakpoints',
'react-feather',
'react-powerplug',
'webfontloader',
]

const depsExternal = [
're-resizable',
'react-dom/server',
'polished/lib/color/rgba',
'polished/lib/color/lighten',
'polished/lib/color/darken',
'react-syntax-highlighter',
'react-syntax-highlighter/prism',
'react-syntax-highlighter/prism-light',
'react-feather/dist/icons/edit-2',
Expand All @@ -18,7 +29,11 @@ const external = Object.keys(pkg.dependencies).concat([
'react-feather/dist/icons/monitor',
'react-feather/dist/icons/maximize',
'react-feather/dist/icons/minimize',
])
]

const external = Object.keys(pkg.dependencies)
.concat(depsExternal)
.filter(dep => internal.indexOf(dep) === -1)

module.exports = {
sourcemap: false,
Expand Down
16 changes: 13 additions & 3 deletions packages/docz/librc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
const pkg = require('./package.json')

const external = Object.keys(pkg.dependencies).concat([
'@mdx-js/tag/dist/mdx-provider',
])
const internal = [
'@sindresorhus/slugify',
'create-react-context',
'array-sort',
'capitalize',
'react-imported-component',
]

const depsExternal = ['@mdx-js/tag/dist/mdx-provider']

const external = Object.keys(pkg.dependencies)
.concat(depsExternal)
.filter(dep => internal.indexOf(dep) === -1)

module.exports = {
external,
Expand Down

0 comments on commit 470bdd3

Please sign in to comment.