Skip to content

Commit

Permalink
Fix sourcemaps, use tiny glob, better build
Browse files Browse the repository at this point in the history
  • Loading branch information
ForsakenHarmony committed Apr 22, 2018
1 parent 63065e2 commit 7e7ba52
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
1 change: 1 addition & 0 deletions .eslintignore
@@ -0,0 +1 @@
dist
28 changes: 14 additions & 14 deletions package.json
Expand Up @@ -7,8 +7,8 @@
"bin": "dist/cli.js",
"scripts": {
"build": "npm run -s build:babel && npm run -s build:self",
"build:babel": "babel-node src/cli.js --format cjs src/*.js --presets env",
"build:self": "node dist/cli.js --format cjs src/*.js",
"build:babel": "babel-node src/cli.js --format cjs src/{cli,index}.js --presets env",
"build:self": "node dist/cli.js --format cjs src/{cli,index}.js",
"prepare": "npm run -s build",
"prepare:babel": "babel --presets env src/*.js -d dist && npm t",
"lint": "eslint src",
Expand Down Expand Up @@ -38,42 +38,42 @@
"dependencies": {
"acorn-jsx": "^4.1.1",
"asyncro": "^3.0.0",
"autoprefixer": "^8.0.0",
"autoprefixer": "^8.3.0",
"babel-polyfill": "^6.26.0",
"camelcase": "^5.0.0",
"chalk": "^2.3.0",
"chalk": "^2.4.0",
"cssnano": "^3.10.0",
"es6-promisify": "^6.0.0",
"glob": "^7.1.2",
"gzip-size": "^4.1.0",
"pretty-bytes": "^4.0.2",
"regenerator-runtime": "^0.11.1",
"rollup": "^0.57.0",
"rollup": "0.58.1",
"rollup-plugin-buble": "^0.19.2",
"rollup-plugin-bundle-size": "^1.0.1",
"rollup-plugin-commonjs": "^9.0.0",
"rollup-plugin-es3": "^1.1.0",
"rollup-plugin-flow": "^1.1.1",
"rollup-plugin-node-resolve": "^3.0.2",
"rollup-plugin-node-resolve": "^3.3.0",
"rollup-plugin-nodent": "^0.2.2",
"rollup-plugin-postcss": "^1.2.7",
"rollup-plugin-postcss": "^1.6.1",
"rollup-plugin-preserve-shebang": "^0.1.6",
"rollup-plugin-sizes": "^0.4.2",
"rollup-plugin-strict-alias": "^1.0.0",
"rollup-plugin-typescript2": "^0.12.0",
"rollup-plugin-typescript2": "^0.13.0",
"rollup-plugin-uglify": "^3.0.0",
"sade": "^1.3.1",
"sade": "^1.4.0",
"tiny-glob": "^0.2.0",
"tslib": "^1.9.0",
"typescript": "^2.6.2"
"typescript": "^2.8.3"
},
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-preset-env": "^1.6.1",
"directory-tree": "^2.0.0",
"eslint": "^4.16.0",
"directory-tree": "^2.1.0",
"eslint": "^4.19.1",
"eslint-config-developit": "^1.1.1",
"fs-extra": "^5.0.0",
"jest": "^22.1.4",
"jest": "^22.4.3",
"rimraf": "^2.6.2",
"shell-quote": "^1.6.1",
"strip-ansi": "^4.0.0"
Expand Down
5 changes: 3 additions & 2 deletions src/index.js
Expand Up @@ -3,7 +3,7 @@ import fs from 'fs';
import { resolve, relative, dirname, basename, extname } from 'path';
import chalk from 'chalk';
import { map, series } from 'asyncro';
import glob from 'glob';
import glob from 'tiny-glob/sync';
import autoprefixer from 'autoprefixer';
import cssnano from 'cssnano';
import { rollup, watch } from 'rollup';
Expand Down Expand Up @@ -62,7 +62,7 @@ export default async function microbundle(options) {
[].concat(
options.entries && options.entries.length ? options.entries : options.pkg.source || (await isDir(resolve(cwd, 'src')) && await jsOrTs('src/index')) || await jsOrTs('index') || options.pkg.module
)
.map(file => glob.sync(resolve(cwd, file)))
.map(file => glob(file))
.forEach(file => options.input.push(...file));

let main = resolve(cwd, options.output || options.pkg.main || 'dist');
Expand Down Expand Up @@ -286,6 +286,7 @@ function createConfig(options, entry, format, writeMeta) {
// }),
options.compress !== false && [
uglify({
sourceMap: true,
output: { comments: false },
compress: {
keep_infinity: true,
Expand Down

0 comments on commit 7e7ba52

Please sign in to comment.