1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-30 02:19:52 +02:00

Improvements to developer experience with building packages (#1595)

* Improvements to developer experience with building packages

* Add note to Contributing.md about watch:packages
This commit is contained in:
Zach Schneider
2018-02-03 20:02:46 -05:00
committed by Ian Storm Taylor
parent b98e675bfb
commit b26bed1c88
4 changed files with 20 additions and 12 deletions

View File

@@ -115,6 +115,11 @@ export default (pkg) => {
format: 'es',
sourcemap: environment === 'development',
},
{
file: `packages/${pkgName}/${output.cjs}`,
format: 'cjs',
exports: 'named',
},
],
external: isExternalDependency,
plugins: [
@@ -146,14 +151,9 @@ export default (pkg) => {
const configurations = [moduleConfig]
if (environment === 'production') {
// In development, we only build the ES version to
// In development, we only build the module version to
// reduce rebuild times. In production, we add the
// configs for the other variants here.
moduleConfig.output.push({
file: `packages/${pkgName}/${output.cjs}`,
format: 'cjs',
exports: 'named',
})
// configs for the UMD variants here.
configurations.push(umdConfig, umdConfigMin)
}