Skip to content

Commit

Permalink
Move index; add unpkg & jsdelivr fields.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed Aug 24, 2018
1 parent d2dd1c2 commit 7a54bdc
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
1 change: 1 addition & 0 deletions .npmignore
@@ -1,3 +1,4 @@
*.sublime-*
dist/*.zip
img/
test/
9 changes: 5 additions & 4 deletions package.json
Expand Up @@ -18,16 +18,17 @@
"name": "Mike Bostock",
"url": "http://bost.ocks.org/mike"
},
"main": "dist/d3-timer.min.js",
"module": "index",
"jsnext:main": "index",
"main": "dist/d3-timer.js",
"unpkg": "dist/d3-timer.min.js",
"jsdelivr": "dist/d3-timer.min.js",
"module": "src/index.js",
"repository": {
"type": "git",
"url": "https://github.com/d3/d3-timer.git"
},
"scripts": {
"pretest": "rollup -c",
"test": "tape 'test/**/*-test.js' && eslint index.js src",
"test": "tape 'test/**/*-test.js' && eslint src",
"prepublishOnly": "rm -rf dist && yarn test",
"postpublish": "git push && git push --tags && cd ../d3.github.com && git pull && cp ../${npm_package_name}/dist/${npm_package_name}.js ${npm_package_name}.v1.js && cp ../${npm_package_name}/dist/${npm_package_name}.min.js ${npm_package_name}.v1.min.js && git add ${npm_package_name}.v1.js ${npm_package_name}.v1.min.js && git commit -m \"${npm_package_name} ${npm_package_version}\" && git push && cd - && zip -j dist/${npm_package_name}.zip -- LICENSE README.md dist/${npm_package_name}.js dist/${npm_package_name}.min.js"
},
Expand Down
6 changes: 3 additions & 3 deletions rollup.config.js
Expand Up @@ -2,16 +2,16 @@ import {terser} from "rollup-plugin-terser";
import * as meta from "./package.json";

const config = {
input: "index.js",
external: Object.keys(meta.dependencies || {}),
input: "src/index.js",
external: Object.keys(meta.dependencies || {}).filter(key => /^d3-/.test(key)),
output: {
file: `dist/${meta.name}.js`,
name: "d3",
format: "umd",
indent: false,
extend: true,
banner: `// ${meta.homepage} v${meta.version} Copyright ${(new Date).getFullYear()} ${meta.author.name}`,
globals: Object.assign({}, ...Object.keys(meta.dependencies || {}).map(key => ({[key]: "d3"})))
globals: Object.assign({}, ...Object.keys(meta.dependencies || {}).filter(key => /^d3-/.test(key)).map(key => ({[key]: "d3"})))
},
plugins: []
};
Expand Down
6 changes: 3 additions & 3 deletions index.js → src/index.js
Expand Up @@ -2,12 +2,12 @@ export {
now,
timer,
timerFlush
} from "./src/timer";
} from "./timer";

export {
default as timeout
} from "./src/timeout";
} from "./timeout";

export {
default as interval
} from "./src/interval";
} from "./interval";

0 comments on commit 7a54bdc

Please sign in to comment.