1
0
Fork 0

fix(build): use absolute paths and windows-friendly chunk tests

This commit is contained in:
ssube 2019-09-18 08:35:45 -05:00
parent 9f11653749
commit 12d4560cac
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
2 changed files with 13 additions and 11 deletions

View File

@ -9,9 +9,11 @@ import typescript from 'rollup-plugin-typescript2';
const metadata = require('../package.json');
const namedExports = require('./rollup-named.json');
const targetPath = process.env['TARGET_PATH'];
const shebang = '#! /usr/bin/env node\n\n';
const rootPath = process.env['ROOT_PATH'];
const targetPath = process.env['TARGET_PATH'];
const bundle = {
external: [
'async_hooks',
@ -19,24 +21,24 @@ const bundle = {
'sinon',
],
input: [
'src/index.ts',
'test/harness.ts',
'test/**/Test*.ts',
join(rootPath, 'src/index.ts'),
join(rootPath, 'test/harness.ts'),
join(rootPath, 'test/**/Test*.ts'),
],
manualChunks(id) {
if (id.includes('/test/')) {
if (id.match(/[\/\\]test[\/\\]/)) {
return 'test'
}
if (id.includes('/node_modules/')) {
if (id.match(/[\/\\]node_modules[\/\\]/)) {
return 'vendor';
}
if (id.includes('/src/index')) {
if (id.match(/[\/\\]src[\/\\]index[\/\\]/)) {
return 'index';
}
if (id.includes('/src/')) {
if (id.match(/[\/\\]src[\/\\]/)) {
return 'main';
}
},
@ -72,11 +74,11 @@ const bundle = {
namedExports,
}),
tslint({
configuration: './config/tslint.json',
configuration: require('./tslint.json'),
throwOnError: true,
}),
typescript({
cacheRoot: 'out/cache/rts2',
cacheRoot: join(targetPath, 'cache/rts2'),
rollupCommonJSResolveHack: true,
}),
],

View File

@ -1,6 +1,6 @@
{
"extends": ["./tslint.cc.json", "tslint-clean-code", "tslint-sonarts"],
"rulesDirectory": ["../node_modules/tslint-microsoft-contrib"],
"rulesDirectory": ["./node_modules/tslint-microsoft-contrib"],
"rules": {
"mocha-unneeded-done": true,
"no-banned-terms": true,