@@ -232,10 +232,7 @@ export async function updateCountBadge(indexes: PackageIndexes) {
232232export async function updatePackageJSON ( indexes : PackageIndexes ) {
233233 const { version } = JSON . parse ( await fs . readFile ( 'package.json' , { encoding : 'utf8' } ) )
234234
235- for ( const { name, description, author, submodules, iife, excludePkgJson } of packages ) {
236- if ( excludePkgJson ) {
237- continue
238- }
235+ for ( const { name, description, author, submodules, iife, manualEntryPoints } of packages ) {
239236 const packageDir = join ( DIR_SRC , name )
240237 const packageJSONPath = join ( packageDir , 'package.json' )
241238 const packageJSON = JSON . parse ( await fs . readFile ( packageJSONPath , { encoding : 'utf8' } ) )
@@ -255,32 +252,35 @@ export async function updatePackageJSON(indexes: PackageIndexes) {
255252 url : 'git+https://github.com/vueuse/vueuse.git' ,
256253 directory : `packages/${ name } ` ,
257254 }
258- packageJSON . main = './dist/index.js'
259- packageJSON . types = './dist/index.d.ts'
260- packageJSON . module = './dist/index.js'
261- if ( iife !== false ) {
262- packageJSON . unpkg = './dist/index.iife.min.js'
263- packageJSON . jsdelivr = './dist/index.iife.min.js'
264- }
265255 packageJSON . files = [
266256 'dist' ,
267257 ]
268258
269- packageJSON . exports = {
270- '.' : './dist/index.js' ,
271- ...packageJSON . exports ,
272- './*' : './dist/*' ,
273- }
274-
275- if ( submodules ) {
276- indexes . functions
277- . filter ( i => i . package === name )
278- . forEach ( ( i ) => {
279- packageJSON . exports [ `./${ i . name } ` ] = `./dist/${ i . name } .js`
280- if ( i . component ) {
281- packageJSON . exports [ `./${ i . name } /component` ] = `./dist/${ i . name } /component.js`
282- }
283- } )
259+ if ( ! manualEntryPoints ) {
260+ packageJSON . main = './dist/index.js'
261+ packageJSON . types = './dist/index.d.ts'
262+ packageJSON . module = './dist/index.js'
263+ if ( iife !== false ) {
264+ packageJSON . unpkg = './dist/index.iife.min.js'
265+ packageJSON . jsdelivr = './dist/index.iife.min.js'
266+ }
267+
268+ packageJSON . exports = {
269+ '.' : './dist/index.js' ,
270+ ...packageJSON . exports ,
271+ './*' : './dist/*' ,
272+ }
273+
274+ if ( submodules ) {
275+ indexes . functions
276+ . filter ( i => i . package === name )
277+ . forEach ( ( i ) => {
278+ packageJSON . exports [ `./${ i . name } ` ] = `./dist/${ i . name } .js`
279+ if ( i . component ) {
280+ packageJSON . exports [ `./${ i . name } /component` ] = `./dist/${ i . name } /component.js`
281+ }
282+ } )
283+ }
284284 }
285285
286286 await fs . writeFile ( packageJSONPath , `${ JSON . stringify ( packageJSON , null , 2 ) } \n` )
0 commit comments