mirror of
https://github.com/developit/microbundle.git
synced 2026-01-25 14:06:50 +00:00
Merge pull request #71 from freeman/rollup-plugin-typescript2
Switch to `rollup-plugin-typescript2`
This commit is contained in:
commit
8905cd463c
@ -59,7 +59,7 @@
|
||||
"rollup-plugin-preserve-shebang": "^0.1.6",
|
||||
"rollup-plugin-sizes": "^0.4.2",
|
||||
"rollup-plugin-strict-alias": "^1.0.0",
|
||||
"rollup-plugin-typescript": "^0.8.1",
|
||||
"rollup-plugin-typescript2": "^0.11",
|
||||
"rollup-plugin-uglify": "^3.0.0",
|
||||
"sade": "^1.3.1",
|
||||
"tslib": "^1.9.0",
|
||||
|
||||
@ -17,7 +17,7 @@ import alias from 'rollup-plugin-strict-alias';
|
||||
import gzipSize from 'gzip-size';
|
||||
import prettyBytes from 'pretty-bytes';
|
||||
import shebangPlugin from 'rollup-plugin-preserve-shebang';
|
||||
import typescript from 'rollup-plugin-typescript';
|
||||
import typescript from 'rollup-plugin-typescript2';
|
||||
import flow from './lib/flow-plugin';
|
||||
import camelCase from 'camelcase';
|
||||
|
||||
@ -216,7 +216,10 @@ function createConfig(options, entry, format, writeMeta) {
|
||||
inject: false,
|
||||
extract: !!writeMeta
|
||||
}),
|
||||
useTypescript && typescript({ typescript: require('typescript') }),
|
||||
useTypescript && typescript({
|
||||
typescript: require('typescript'),
|
||||
tsconfigDefaults: { compilerOptions: { declaration: true } }
|
||||
}),
|
||||
!useTypescript && flow({ all: true, pretty: true }),
|
||||
nodent({
|
||||
exclude: 'node_modules/**',
|
||||
|
||||
@ -41,6 +41,8 @@ Build output to dist:
|
||||
exports[`fixtures ts-demo 1`] = `
|
||||
"ts-demo
|
||||
dist
|
||||
car.d.ts
|
||||
index.d.ts
|
||||
ts-demo.js
|
||||
ts-demo.js.map
|
||||
ts-demo.m.js
|
||||
|
||||
2
test/fixtures/ts-demo/src/car.ts
vendored
2
test/fixtures/ts-demo/src/car.ts
vendored
@ -1,4 +1,4 @@
|
||||
interface Driveable {
|
||||
export interface Driveable {
|
||||
drive(distance: number): boolean;
|
||||
}
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@ const constant = konst => () => konst;
|
||||
|
||||
const printTree = (nodes, indentLevel = 0) => {
|
||||
const indent = join(times(indentLevel, constant(' ')));
|
||||
return join(nodes.map(node =>
|
||||
return join(nodes.filter(node => node.name[0] !== '.').map(node =>
|
||||
`${indent}${node.name}\n${node.type === 'directory' ? printTree(node.children, indentLevel + 1) : ''}`
|
||||
));
|
||||
};
|
||||
@ -26,10 +26,13 @@ describe('fixtures', () => {
|
||||
}
|
||||
|
||||
it(fixtureDir, async () => {
|
||||
const prevDir = process.cwd();
|
||||
process.chdir(path.resolve(fixturePath));
|
||||
const output = await microbundle({
|
||||
cwd: path.resolve(fixturePath),
|
||||
formats: 'es,cjs,umd'
|
||||
});
|
||||
process.chdir(prevDir);
|
||||
|
||||
const printedDir = printTree([dirTree(fixturePath)]);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user