fix: speed up webpacking

This commit is contained in:
Nathan Nichols
2021-09-24 07:57:52 -07:00
parent d4636dcd40
commit 718298c354
3 changed files with 10 additions and 28 deletions

View File

@@ -0,0 +1,8 @@
/* eslint-disable import/export -- Tells webpack which files exist. */
export * from './integration'
export * from './transactions/signerListSet'
export * from './transactions/payment'
export * from './transactions/offerCreate'
export * from './transactions/offerCancel'
export * from './transactions/signerListSet'
export * from './requests/utility'

View File

@@ -17,12 +17,7 @@
mocha.ui('bdd')
</script>
<script src="../testCompiledForWeb/offerCancel.js"></script>
<script src="../testCompiledForWeb/offerCreate.js"></script>
<script src="../testCompiledForWeb/payment.js"></script>
<script src="../testCompiledForWeb/signerListSet.js"></script>
<script src="../testCompiledForWeb/utility.js"></script>
<script src="../testCompiledForWeb/integration.js"></script>
<script src="../testCompiledForWeb/index.js"></script>
<script>
mocha.run()

View File

@@ -120,30 +120,9 @@ function webpackForTest(testFileName) {
},
},
}
// return Object.assign({}, getDefaultConfiguration(), test)
return test
}
function webpackIntegrationTests() {
const dir = './test/integration/'
const tests = []
const dirPaths = fs.readdirSync(dir)
tests.push(webpackForTest(`./${path.join(dir, 'integration.ts')}`))
const subdirs = dirPaths.filter(
(filename) =>
!filename.match(/\/?([^\/]*)\.ts$/) && filename !== 'README.md',
)
subdirs.forEach((subdir) => {
const subdirPaths = fs.readdirSync(path.join(dir, subdir))
subdirPaths.forEach((filename) => {
tests.push(webpackForTest(`./${path.join(dir, subdir, filename)}`))
})
})
return tests.map(
(test) => (env, argv) => Object.assign({}, getDefaultConfiguration(), test),
)
}
module.exports = [
(env, argv) => {
const config = getDefaultConfiguration()
@@ -160,5 +139,5 @@ module.exports = [
}
return config
},
...webpackIntegrationTests(),
(env, argv) => webpackForTest('./test/integration/index.ts'),
]