Comparing version 4.0.0 to 5.0.0
{ | ||
"name": "ipjs", | ||
"version": "4.0.0", | ||
"version": "5.0.0", | ||
"description": "Universal JavaScript build and packaging system", | ||
@@ -5,0 +5,0 @@ "main": "src/build.js", |
@@ -28,4 +28,7 @@ import packager from './package/index.js' | ||
} | ||
run.schema = { tests: false } | ||
run.schema = { | ||
tests: false, | ||
main: false | ||
} | ||
export default run |
@@ -21,3 +21,3 @@ import { promises as fs } from 'fs' | ||
class Package { | ||
constructor ({ cwd, hooks, tests }) { | ||
constructor ({ cwd, hooks, tests, main }) { | ||
this.cwd = cwd | ||
@@ -29,2 +29,3 @@ this.hooks = hooks || {} | ||
this.includeTests = tests | ||
this.includeMain = main | ||
} | ||
@@ -186,3 +187,7 @@ | ||
delete json.type | ||
json.main = `./${join('./cjs', json.main || './index.js')}` | ||
if (this.includeMain) { | ||
json.main = `./${join('./cjs', json.main || './index.js')}` | ||
} else { | ||
delete json.main | ||
} | ||
json.browser = {} | ||
@@ -189,0 +194,0 @@ json.exports = {} |
@@ -5,3 +5,2 @@ { | ||
"description": "", | ||
"main": "./cjs/src/index.js", | ||
"scripts": { | ||
@@ -8,0 +7,0 @@ "test": "echo \"Error: no test specified\" && exit 1" |
@@ -5,3 +5,2 @@ { | ||
"description": "", | ||
"main": "./cjs/src/index.js", | ||
"scripts": { | ||
@@ -8,0 +7,0 @@ "test": "echo \"Error: no test specified\" && exit 1" |
@@ -63,2 +63,11 @@ import build from '../src/build.js' | ||
}) | ||
test('pkg-kitchensink w/ main', async test => { | ||
const dist = pathToFileURL(await tempy.directory()) | ||
test.after(() => rmtree(fileURLToPath(dist))) | ||
const opts = { cwd, dist, main: true } | ||
await build(opts) | ||
await verify(new URL('./output-main', url), dist) | ||
await verify(dist, new URL('./output-main', url)) | ||
}) | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
53431
100
1448