Skip to content

Commit 2dd10e5

Browse files
Merge branch 'master' into remove_import_pruning
2 parents 296026b + 0013f24 commit 2dd10e5

12 files changed

Lines changed: 104 additions & 13 deletions

File tree

β€Ž.travis.ymlβ€Ž

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
language: node_js
22
node_js:
33
- "node"
4+
branches:
5+
except:
6+
- trying.tmp
7+
- staging.tmp

β€Žbors.tomlβ€Ž

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
status = [
2+
"continuous-integration/travis-ci/push",
3+
]
4+
delete_merged_branches = true

β€Žpackage.jsonβ€Ž

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "microbundle",
3-
"version": "0.8.3",
3+
"version": "0.8.4",
44
"description": "Zero-configuration bundler for tiny JS libs, powered by Rollup.",
55
"main": "dist/microbundle.js",
66
"source": "src/index.js",
@@ -12,7 +12,7 @@
1212
"prepare": "npm run -s build",
1313
"prepare:babel": "babel src/*.js -d dist && npm t",
1414
"lint": "eslint src",
15-
"test": "npm run -s lint && npm run -s build && BABEL_ENV=test jest",
15+
"test": "npm run -s lint && npm run -s build && cross-env BABEL_ENV=test jest",
1616
"release": "npm run -s prepare && npm test && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish"
1717
},
1818
"repository": "developit/microbundle",
@@ -48,7 +48,7 @@
4848
"@babel/polyfill": "^7.0.0",
4949
"asyncro": "^3.0.0",
5050
"autoprefixer": "^9.0.0",
51-
"babel-plugin-transform-async-to-promises": "^0.8.1",
51+
"babel-plugin-transform-async-to-promises": "^0.8.3",
5252
"brotli-size": "^0.0.3",
5353
"camelcase": "^5.0.0",
5454
"chalk": "^2.4.0",
@@ -81,6 +81,7 @@
8181
"@babel/preset-env": "^7.1.6",
8282
"babel-core": "^7.0.0-bridge.0",
8383
"babel-jest": "^23.6.0",
84+
"cross-env": "^5.2.0",
8485
"directory-tree": "^2.1.0",
8586
"eslint": "^5.0.0",
8687
"eslint-config-developit": "^1.1.1",

β€Žsrc/index.jsβ€Ž

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,8 @@ function createConfig(options, entry, format, writeMeta) {
339339
browser: options.target !== 'node',
340340
}),
341341
commonjs({
342-
include: 'node_modules/**',
342+
// use a regex to make sure to include eventual hoisted packages
343+
include: /\/node_modules\//,
343344
}),
344345
json(),
345346
useTypescript &&
@@ -355,7 +356,7 @@ function createConfig(options, entry, format, writeMeta) {
355356
},
356357
tsconfigOverride: {
357358
compilerOptions: {
358-
target: 'es2017',
359+
target: 'esnext',
359360
},
360361
},
361362
}),
@@ -367,6 +368,7 @@ function createConfig(options, entry, format, writeMeta) {
367368
// supplied configurations we set this option to false. Note
368369
// that we never supported using custom babel configs anyway.
369370
babelrc: false,
371+
extensions: ['.ts', '.tsx', '.js', '.jsx', '.es6', '.es', '.mjs'],
370372
exclude: 'node_modules/**',
371373
plugins: [
372374
require.resolve('@babel/plugin-syntax-jsx'),

β€Žtest/__snapshots__/index.test.js.snapβ€Ž

Lines changed: 64 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,63 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3+
exports[`fixtures async-iife-ts 1`] = `
4+
"Used script: microbundle
5+
6+
Directory tree:
7+
8+
async-iife-ts
9+
dist
10+
async-iife-ts.js
11+
async-iife-ts.js.map
12+
async-iife-ts.mjs
13+
async-iife-ts.mjs.map
14+
async-iife-ts.umd.js
15+
async-iife-ts.umd.js.map
16+
index.d.ts
17+
package.json
18+
src
19+
index.ts
20+
tsconfig.json
21+
22+
23+
Build \\"asyncIifeTs\\" to dist:
24+
93 B: async-iife-ts.js.gz
25+
74 B: async-iife-ts.js.br
26+
93 B: async-iife-ts.mjs.gz
27+
74 B: async-iife-ts.mjs.br
28+
164 B: async-iife-ts.umd.js.gz
29+
123 B: async-iife-ts.umd.js.br"
30+
`;
31+
32+
exports[`fixtures async-ts 1`] = `
33+
"Used script: microbundle
34+
35+
Directory tree:
36+
37+
async-ts
38+
dist
39+
async-ts.js
40+
async-ts.js.map
41+
async-ts.mjs
42+
async-ts.mjs.map
43+
async-ts.umd.js
44+
async-ts.umd.js.map
45+
index.d.ts
46+
package.json
47+
src
48+
index.ts
49+
tsconfig.json
50+
51+
52+
Build \\"asyncTs\\" to dist:
53+
75 B: async-ts.js.gz
54+
57 B: async-ts.js.br
55+
77 B: async-ts.mjs.gz
56+
63 B: async-ts.mjs.br
57+
176 B: async-ts.umd.js.gz
58+
141 B: async-ts.umd.js.br"
59+
`;
60+
361
exports[`fixtures basic 1`] = `
462
"Used script: microbundle
563
@@ -337,12 +395,12 @@ esnext-ts
337395
338396
339397
Build \\"esnextTs\\" to dist:
340-
470 B: esnext-ts.js.gz
341-
404 B: esnext-ts.js.br
342-
470 B: esnext-ts.mjs.gz
343-
409 B: esnext-ts.mjs.br
344-
528 B: esnext-ts.umd.js.gz
345-
461 B: esnext-ts.umd.js.br"
398+
1204 B: esnext-ts.js.gz
399+
1096 B: esnext-ts.js.br
400+
1203 B: esnext-ts.mjs.gz
401+
1094 B: esnext-ts.mjs.br
402+
1260 B: esnext-ts.umd.js.gz
403+
1146 B: esnext-ts.umd.js.br"
346404
`;
347405

348406
exports[`fixtures jsx 1`] = `
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"name": "async-iife-ts"
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
(async function() {
2+
console.log('foo');
3+
})();
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"compilerOptions": {
3+
"rootDir": "./src"
4+
}
5+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"name": "async-ts"
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export class MyClass {
2+
async foo() {}
3+
}

0 commit comments

Comments
Β (0)