Skip to content

Commit

Permalink
Merge branch 'master' into remove_import_pruning
Browse files Browse the repository at this point in the history
  • Loading branch information
ForsakenHarmony committed Dec 18, 2018
2 parents 296026b + 0013f24 commit 2dd10e5
Show file tree
Hide file tree
Showing 12 changed files with 104 additions and 13 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
@@ -1,3 +1,7 @@
language: node_js
node_js:
- "node"
branches:
except:
- trying.tmp
- staging.tmp
4 changes: 4 additions & 0 deletions bors.toml
@@ -0,0 +1,4 @@
status = [
"continuous-integration/travis-ci/push",
]
delete_merged_branches = true
7 changes: 4 additions & 3 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "microbundle",
"version": "0.8.3",
"version": "0.8.4",
"description": "Zero-configuration bundler for tiny JS libs, powered by Rollup.",
"main": "dist/microbundle.js",
"source": "src/index.js",
Expand All @@ -12,7 +12,7 @@
"prepare": "npm run -s build",
"prepare:babel": "babel src/*.js -d dist && npm t",
"lint": "eslint src",
"test": "npm run -s lint && npm run -s build && BABEL_ENV=test jest",
"test": "npm run -s lint && npm run -s build && cross-env BABEL_ENV=test jest",
"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"
},
"repository": "developit/microbundle",
Expand Down Expand Up @@ -48,7 +48,7 @@
"@babel/polyfill": "^7.0.0",
"asyncro": "^3.0.0",
"autoprefixer": "^9.0.0",
"babel-plugin-transform-async-to-promises": "^0.8.1",
"babel-plugin-transform-async-to-promises": "^0.8.3",
"brotli-size": "^0.0.3",
"camelcase": "^5.0.0",
"chalk": "^2.4.0",
Expand Down Expand Up @@ -81,6 +81,7 @@
"@babel/preset-env": "^7.1.6",
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "^23.6.0",
"cross-env": "^5.2.0",
"directory-tree": "^2.1.0",
"eslint": "^5.0.0",
"eslint-config-developit": "^1.1.1",
Expand Down
6 changes: 4 additions & 2 deletions src/index.js
Expand Up @@ -339,7 +339,8 @@ function createConfig(options, entry, format, writeMeta) {
browser: options.target !== 'node',
}),
commonjs({
include: 'node_modules/**',
// use a regex to make sure to include eventual hoisted packages
include: /\/node_modules\//,
}),
json(),
useTypescript &&
Expand All @@ -355,7 +356,7 @@ function createConfig(options, entry, format, writeMeta) {
},
tsconfigOverride: {
compilerOptions: {
target: 'es2017',
target: 'esnext',
},
},
}),
Expand All @@ -367,6 +368,7 @@ function createConfig(options, entry, format, writeMeta) {
// supplied configurations we set this option to false. Note
// that we never supported using custom babel configs anyway.
babelrc: false,
extensions: ['.ts', '.tsx', '.js', '.jsx', '.es6', '.es', '.mjs'],
exclude: 'node_modules/**',
plugins: [
require.resolve('@babel/plugin-syntax-jsx'),
Expand Down
70 changes: 64 additions & 6 deletions test/__snapshots__/index.test.js.snap
@@ -1,5 +1,63 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`fixtures async-iife-ts 1`] = `
"Used script: microbundle
Directory tree:
async-iife-ts
dist
async-iife-ts.js
async-iife-ts.js.map
async-iife-ts.mjs
async-iife-ts.mjs.map
async-iife-ts.umd.js
async-iife-ts.umd.js.map
index.d.ts
package.json
src
index.ts
tsconfig.json
Build \\"asyncIifeTs\\" to dist:
93 B: async-iife-ts.js.gz
74 B: async-iife-ts.js.br
93 B: async-iife-ts.mjs.gz
74 B: async-iife-ts.mjs.br
164 B: async-iife-ts.umd.js.gz
123 B: async-iife-ts.umd.js.br"
`;

exports[`fixtures async-ts 1`] = `
"Used script: microbundle
Directory tree:
async-ts
dist
async-ts.js
async-ts.js.map
async-ts.mjs
async-ts.mjs.map
async-ts.umd.js
async-ts.umd.js.map
index.d.ts
package.json
src
index.ts
tsconfig.json
Build \\"asyncTs\\" to dist:
75 B: async-ts.js.gz
57 B: async-ts.js.br
77 B: async-ts.mjs.gz
63 B: async-ts.mjs.br
176 B: async-ts.umd.js.gz
141 B: async-ts.umd.js.br"
`;

exports[`fixtures basic 1`] = `
"Used script: microbundle
Expand Down Expand Up @@ -337,12 +395,12 @@ esnext-ts
Build \\"esnextTs\\" to dist:
470 B: esnext-ts.js.gz
404 B: esnext-ts.js.br
470 B: esnext-ts.mjs.gz
409 B: esnext-ts.mjs.br
528 B: esnext-ts.umd.js.gz
461 B: esnext-ts.umd.js.br"
1204 B: esnext-ts.js.gz
1096 B: esnext-ts.js.br
1203 B: esnext-ts.mjs.gz
1094 B: esnext-ts.mjs.br
1260 B: esnext-ts.umd.js.gz
1146 B: esnext-ts.umd.js.br"
`;

exports[`fixtures jsx 1`] = `
Expand Down
3 changes: 3 additions & 0 deletions test/fixtures/async-iife-ts/package.json
@@ -0,0 +1,3 @@
{
"name": "async-iife-ts"
}
3 changes: 3 additions & 0 deletions test/fixtures/async-iife-ts/src/index.ts
@@ -0,0 +1,3 @@
(async function() {
console.log('foo');
})();
5 changes: 5 additions & 0 deletions test/fixtures/async-iife-ts/tsconfig.json
@@ -0,0 +1,5 @@
{
"compilerOptions": {
"rootDir": "./src"
}
}
3 changes: 3 additions & 0 deletions test/fixtures/async-ts/package.json
@@ -0,0 +1,3 @@
{
"name": "async-ts"
}
3 changes: 3 additions & 0 deletions test/fixtures/async-ts/src/index.ts
@@ -0,0 +1,3 @@
export class MyClass {
async foo() {}
}
5 changes: 5 additions & 0 deletions test/fixtures/async-ts/tsconfig.json
@@ -0,0 +1,5 @@
{
"compilerOptions": {
"rootDir": "./src"
}
}
4 changes: 2 additions & 2 deletions test/fixtures/esnext-ts/src/index.ts
@@ -1,10 +1,10 @@
export default async function foo() {
const out = [];
for await (const item of [1,2]) {
for await (const item of [1, 2]) {
out.push(item);
}

return out;
}

foo().then(console.log)
foo().then(console.log);

0 comments on commit 2dd10e5

Please sign in to comment.