Skip to content

Commit

Permalink
fix(docz-rollup): fixed rollup configs to be Windows tolerant (#812)
Browse files Browse the repository at this point in the history
  • Loading branch information
patricksevat authored and pedronauck committed Apr 18, 2019
1 parent 503cde4 commit 10f6bfd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
9 changes: 7 additions & 2 deletions core/docz-rollup/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ const babel = require('rollup-plugin-babel')
const sizePlugin = require('./plugins/size')
const copyPlugin = require('./plugins/copy')

const defaultExternal = id =>
!id.startsWith('\0') && !id.startsWith('.') && !id.startsWith('/')
const defaultExternal = id => {
return (
!id.startsWith('\0') &&
!id.startsWith('.') &&
!id.startsWith(process.platform === 'win32' ? process.cwd() : '/')
)
}

const output = (format, outputDir, { plugins = [], external, ...opts }) => ({
...opts,
Expand Down
2 changes: 1 addition & 1 deletion core/docz-theme-default/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default config({
external: id =>
!id.startsWith('\0') &&
!id.startsWith('.') &&
!id.startsWith('/') &&
!id.startsWith(process.platform === 'win32' ? process.cwd() : '/') &&
!id.startsWith('@components') &&
!id.startsWith('@utils') &&
!id.startsWith('@styles'),
Expand Down
4 changes: 3 additions & 1 deletion core/docz/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ import { config } from 'docz-rollup'
export default config({
input: 'src/index.ts',
external: id =>
!id.startsWith('\0') && !id.startsWith('.') && !id.startsWith('/'),
!id.startsWith('\0') &&
!id.startsWith('.') &&
!id.startsWith(process.platform === 'win32' ? process.cwd() : '/')
})

0 comments on commit 10f6bfd

Please sign in to comment.