Revert "WIP: test: add tree-shaking test (#8979)"
This reverts commit b746c64229
.
Reason: bad merge via github ui
This commit is contained in:
parent
b746c64229
commit
d18694a1c3
|
@ -10,6 +10,7 @@
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"rxjs": "5.0.0-beta.6",
|
"rxjs": "5.0.0-beta.6",
|
||||||
"@angular/core": "0.0.0-PLACEHOLDER",
|
"@angular/core": "0.0.0-PLACEHOLDER",
|
||||||
|
"@angular/common": "0.0.0-PLACEHOLDER",
|
||||||
"@angular/platform-browser": "0.0.0-PLACEHOLDER"
|
"@angular/platform-browser": "0.0.0-PLACEHOLDER"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
Rollup tree-shaking test
|
|
||||||
------------------------
|
|
||||||
|
|
||||||
The purpose of this test is to verify how much stuff can be tree-shaken from our packages.
|
|
||||||
|
|
||||||
The test generates an empty js file that imports everything from a particular package but doesn't
|
|
||||||
use any of the imported references.
|
|
||||||
|
|
||||||
In the ideal scenario Rollup should detect that none of the references are being used and should
|
|
||||||
create an empty bundle file.
|
|
||||||
|
|
||||||
In reality there is a lot of stuff preserved in the bundle because Rollup is currently not able to
|
|
||||||
make a safe decision to remove many of the unused symbols.
|
|
||||||
|
|
||||||
To run execute: `./tools/tree-shaking-test/test.sh`
|
|
||||||
|
|
||||||
then inspect `dist/tree-shaking/test/**/*.bundle.js`
|
|
|
@ -1,20 +0,0 @@
|
||||||
class RollupNG2 {
|
|
||||||
resolveId(id, from){
|
|
||||||
if(id.startsWith('@angular/')){
|
|
||||||
return `${__dirname}/../../packages-dist/${id.split('/')[1]}/esm/index.js`;
|
|
||||||
}
|
|
||||||
|
|
||||||
// if(id.startsWith('rxjs/')){
|
|
||||||
// return `${__dirname}/../../../node_modules/rxjs-es/${id.replace('rxjs/', '')}.js`;
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
export default {
|
|
||||||
entry: 'test.js',
|
|
||||||
format: 'es6',
|
|
||||||
plugins: [
|
|
||||||
new RollupNG2(),
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -1,35 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -ex -o pipefail
|
|
||||||
|
|
||||||
cd `dirname $0`
|
|
||||||
cd ../..
|
|
||||||
|
|
||||||
export NODE_PATH=${NODE_PATH}:$(pwd)/dist-packages/
|
|
||||||
|
|
||||||
DEST_DIR=./dist/trees-shaking-test
|
|
||||||
|
|
||||||
rm -rf ${DEST_DIR}
|
|
||||||
|
|
||||||
for PACKAGE in \
|
|
||||||
core \
|
|
||||||
compiler \
|
|
||||||
common \
|
|
||||||
platform-browser \
|
|
||||||
platform-server \
|
|
||||||
http \
|
|
||||||
router \
|
|
||||||
upgrade
|
|
||||||
do
|
|
||||||
echo "======= Tree-shaking TEST: ${SRCDIR} ====="
|
|
||||||
TEST_DIR=${DEST_DIR}/${PACKAGE}
|
|
||||||
TEST_ENTRY_POINT=${TEST_DIR}/test.js
|
|
||||||
mkdir -p ${TEST_DIR}
|
|
||||||
cp ./tools/tree-shaking-test/rollup.config.js ${TEST_DIR}/
|
|
||||||
echo "import * as x from '@angular/${PACKAGE}'" > ${TEST_ENTRY_POINT}
|
|
||||||
(
|
|
||||||
cd ${TEST_DIR}
|
|
||||||
$(npm bin)/rollup --config rollup.config.js --output ${PACKAGE}.bundle.js
|
|
||||||
)
|
|
||||||
|
|
||||||
done
|
|
Loading…
Reference in New Issue