-
Notifications
You must be signed in to change notification settings - Fork 263
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
57dde10
commit d86dd87
Showing
18 changed files
with
121 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import commonjs from '@rollup/plugin-commonjs' | ||
import typescript from '@rollup/plugin-typescript' | ||
|
||
const path = require('path') | ||
const config = require('./src/config.json') | ||
|
||
const entries = { | ||
'nutui-react.es': path.join( | ||
__dirname, | ||
`./src/packages/nutui.taro.react.build.ts` | ||
), | ||
} | ||
const outputEntries = {} | ||
|
||
config.nav.map((item) => { | ||
item.packages.forEach((element) => { | ||
const { name, show, type, exportEmpty } = element | ||
if (show || exportEmpty) { | ||
outputEntries[`./${name.toLowerCase()}`] = `./${name}` | ||
entries[name] = path.join( | ||
__dirname, | ||
`./src/packages/${name.toLowerCase()}/index.taro.ts` | ||
) | ||
} | ||
}) | ||
}) | ||
|
||
export default { | ||
input: entries, | ||
external: (id, parent) => { | ||
;/^react/.test(id) || | ||
/^react-dom/.test(id) || | ||
/^classnames/.test(id) || | ||
/^@use-gesture/.test(id) || | ||
/^@react-spring/.test(id) || | ||
/^@bem-react/.test(id) || | ||
(/^@\/packages\/\w+$/.test(id) && !!parent) | ||
}, | ||
output: { | ||
format: 'esm', | ||
dir: './dist/esm', | ||
name: '[entryName].js', | ||
paths: (id) => { | ||
return /@\/packages/.test(id) | ||
? `${outputEntries[id.replace('@/packages/', './')]}.js` | ||
: id | ||
}, | ||
}, | ||
plugins: [commonjs(), typescript()], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const path = require('path') | ||
const fsExtra = require('fs-extra') | ||
|
||
fsExtra.copySync( | ||
path.join(process.cwd(), '.cache/package.json.bk'), | ||
path.join(process.cwd(), 'package.json'), | ||
{ overwrite: true } | ||
) | ||
|
||
fsExtra.removeSync(path.join(process.cwd(), '.cache/package.json.bk')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const path = require('path') | ||
const fsExtra = require('fs-extra') | ||
const packageData = require('../package.json') | ||
|
||
const cachePath = path.join(process.cwd(), '.cache/') | ||
if (!fsExtra.ensureDirSync(cachePath)) { | ||
fsExtra.mkdirpSync(cachePath) | ||
} | ||
|
||
fsExtra.copySync( | ||
path.join(process.cwd(), 'package.json'), | ||
path.join(cachePath, 'package.json.bk'), | ||
{ overwrite: true } | ||
) | ||
|
||
if (packageData.name.indexOf('-taro') > -1) { | ||
delete packageData.dependencies['@nutui/icons-react'] | ||
} else { | ||
delete packageData.dependencies['@nutui/icons-react-taro'] | ||
} | ||
|
||
delete packageData.devDependencies | ||
packageData.scripts = {} | ||
|
||
packageData.scripts['postpublish'] = 'node scripts/postpublish.js' | ||
|
||
fsExtra.writeJsonSync(path.join(process.cwd(), 'package.json'), packageData, { | ||
spaces: 2, | ||
}) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
import { ConfigProvider } from './configprovider.taro' | ||
import { | ||
ConfigProvider, | ||
useConfig, | ||
setDefaultConfig, | ||
getDefaultConfig, | ||
} from './configprovider.taro' | ||
|
||
export { useConfig, setDefaultConfig, getDefaultConfig } | ||
export default ConfigProvider |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters