1- import { bundle , clean , TSRollupConfig , copy , replaceContent , symlinkDir } from 'aria-build'
1+ import { bundle , clean , TSRollupConfig , copy , replaceContent , symlinkDir , writeFile } from 'aria-build'
22import { builtinModules } from 'module'
33
44( async function ( ) {
55 const pkg = require ( '../package.json' )
66
7+ async function addPostInstall ( ) {
8+ const json = require ( '../dist/package.json' )
9+ json . scripts = {
10+ "prepare" : "node ./node_modules/aria-vue/tools/patch.js"
11+ }
12+ await writeFile ( './dist/package.json' , JSON . stringify ( json , null , 2 ) )
13+ }
14+
715 const external = [
816 'sade' ,
917 ...Object . keys ( pkg . dependencies ) ,
1018 ...Object . keys ( pkg . peerDependencies ) ,
1119 ...Object . keys ( pkg . devDependencies ) ,
12- ...builtinModules
20+ ...builtinModules ,
21+ 'rollup' ,
22+ '@rollup/plugin-node-resolve' ,
23+ '@rollup/plugin-commonjs'
1324 ]
1425
1526 function replace ( filename : string ) {
@@ -28,7 +39,8 @@ import { builtinModules } from 'module'
2839 copy ( {
2940 targets : [
3041 { src : './src/*.html' , dest : 'dist' } ,
31- { src : 'bin/*' , dest : 'dist/bin' , replace }
42+ { src : 'bin/*' , dest : 'dist/bin' , replace } ,
43+ { src : './tools/*.js' , dest : './dist/tools' }
3244 ]
3345 } )
3446 ] ,
@@ -54,6 +66,7 @@ import { builtinModules } from 'module'
5466
5567 await clean ( 'dist' )
5668 await bundle ( { config, esbuild : true , write : true } )
69+ await addPostInstall ( )
5770 await Promise . all ( [
5871 symlinkDir ( './node_modules' , './example/node_modules' ) ,
5972 symlinkDir ( './dist' , './node_modules/aria-vue' )
0 commit comments