🔧 Added custom rollup config for tests
This commit is contained in:
parent
5948ae7386
commit
d48080bbb5
2 changed files with 28 additions and 3 deletions
|
@ -27,12 +27,13 @@
|
||||||
"clean": "rimraf dist",
|
"clean": "rimraf dist",
|
||||||
"nodebuild": "BABEL_ENV=production rollup -c -o dist/index.js -f cjs",
|
"nodebuild": "BABEL_ENV=production rollup -c -o dist/index.js -f cjs",
|
||||||
"modulebuild": "BABEL_ENV=production rollup -c -o dist/index.mjs -f es",
|
"modulebuild": "BABEL_ENV=production rollup -c -o dist/index.mjs -f es",
|
||||||
"build": "npm run clean && npm run nodebuild && npm run modulebuild",
|
"build": "npm run clean && rollup -c && rollup -c rollup.tests.js",
|
||||||
"test": "BABEL_ENV=production nyc mocha tests/*.test.js",
|
"testonly": "BABEL_ENV=production mocha tests/*.test.js",
|
||||||
|
"test": "BABEL_ENV=production nyc -x node_modules -x tests/fixtures -x bin-pack mocha tests/*.test.js",
|
||||||
"pubtest": "npm publish --registry http://localhost:6662",
|
"pubtest": "npm publish --registry http://localhost:6662",
|
||||||
"pubforce": "npm publish",
|
"pubforce": "npm publish",
|
||||||
"symlink": "mkdir -p ./node_modules/@freesewing && cd ./node_modules/@freesewing && ln -s -f ../../../* . && cd -",
|
"symlink": "mkdir -p ./node_modules/@freesewing && cd ./node_modules/@freesewing && ln -s -f ../../../* . && cd -",
|
||||||
"report": "BABEL_ENV=production nyc report --reporter=html mocha --compilers js:babel-core/register tests/*.test.js",
|
"report": "BABEL_ENV=production nyc report --reporter=html",
|
||||||
"coverage": "BABEL_ENV=production nyc npm test && nyc report --reporter=text-lcov > coverage.lcov && ./node_modules/.bin/codecov",
|
"coverage": "BABEL_ENV=production nyc npm test && nyc report --reporter=text-lcov > coverage.lcov && ./node_modules/.bin/codecov",
|
||||||
"watch": "BABEL_ENV=production rollup -c -w -o dist/index.mjs -f es"
|
"watch": "BABEL_ENV=production rollup -c -w -o dist/index.mjs -f es"
|
||||||
},
|
},
|
||||||
|
|
24
packages/core/rollup.tests.js
Normal file
24
packages/core/rollup.tests.js
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
import babel from "rollup-plugin-babel";
|
||||||
|
import resolve from "rollup-plugin-node-resolve";
|
||||||
|
import commonjs from "rollup-plugin-commonjs";
|
||||||
|
import json from "rollup-plugin-json";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
input: "src/index.js",
|
||||||
|
output: [
|
||||||
|
{
|
||||||
|
file: "tests/dist/index.js",
|
||||||
|
format: "cjs",
|
||||||
|
sourcemap: true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
plugins: [
|
||||||
|
resolve(),
|
||||||
|
json(),
|
||||||
|
commonjs(),
|
||||||
|
babel({
|
||||||
|
exclude: "node_modules/**",
|
||||||
|
plugins: ["@babel/plugin-proposal-object-rest-spread"]
|
||||||
|
})
|
||||||
|
]
|
||||||
|
};
|
Loading…
Add table
Add a link
Reference in a new issue