Skip to content

Commit

Permalink
chore: pin node to common-js
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob-alford committed Feb 2, 2023
1 parent 74b7359 commit a816714
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions scripts/pack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,16 @@ export const copyPackageJson: Build<void> = C =>
exports: {
'.': {
types: './index.d.ts',
node: './index.js',
import: './_esm/index.mjs',
require: './index.js',
},
'./*': { types: './*.d.ts', import: './_esm/*.mjs', require: './*.js' },
'./*': {
types: './*.d.ts',
node: './*.js',
import: './_esm/*.mjs',
require: './*.js',
},
},
publishConfig: {
access: 'public',
Expand Down Expand Up @@ -78,9 +84,9 @@ export const rewriteSourceMap: (
? v.map(source => {
let clone = `${source}`
if (path_.match(/dist\/_(.+)\//)) {
clone = clone.replace(/(.*)\.\.\/src(.*)/gm, '$1_src$2')
clone = clone.replace(/(.*)\.\.\/src(.*)/gm, '$1src$2')
} else {
clone = clone.replace(/(.*)\.\.\/\.\.\/src(.*)/gm, '$1_src$2')
clone = clone.replace(/(.*)\.\.\/\.\.\/src(.*)/gm, '$1src$2')
}
clone = path.posix.relative(dir, path.posix.join(dir, clone))
return clone.startsWith('.') ? clone : './' + clone
Expand All @@ -104,8 +110,8 @@ export const copyMetaFiles: Build<ReadonlyArray<void>> = C =>

export const copyBuildFiles: Build<void> = C =>
pipe(
C.mkdir(`./dist/_src`),
TE.chain(() => C.exec('cp -r ./src/* ./dist/_src')),
C.mkdir(`./dist/src`),
TE.chain(() => C.exec('cp -r ./src/* ./dist/src')),

/* Copy build/esm to dist/_esm */
TE.chain(() => C.mkdir('./dist/_esm')),
Expand Down

0 comments on commit a816714

Please sign in to comment.