Also replaces the prepublish script with prepublishOnly per npm, and replaces
the browser field in package.json with unpkg and jsdelivr; see #3138.
This commit is contained in:
Mike Bostock 2017-09-02 15:28:43 -07:00
Родитель 5524246f04
Коммит 39154c5701
3 изменённых файлов: 16 добавлений и 12 удалений

Просмотреть файл

@ -16,7 +16,8 @@
"url": "https://bost.ocks.org/mike"
},
"main": "build/d3.node.js",
"browser": "build/d3.js",
"unpkg": "build/d3.js",
"jsdelivr": "build/d3.js",
"module": "index",
"jsnext:main": "index",
"repository": {
@ -26,18 +27,18 @@
"scripts": {
"pretest": "rimraf build && mkdir build && json2module package.json > build/package.js && node rollup.node",
"test": "tape 'test/**/*-test.js'",
"prepublish": "npm run test && rollup -c --banner \"$(preamble)\" -o build/d3.js && uglifyjs -b beautify=false,preamble=\"'$(preamble)'\" build/d3.js -c negate_iife=false -m -o build/d3.min.js",
"prepublishOnly": "npm run test && rollup -c --banner \"$(preamble)\" && uglifyjs -b beautify=false,preamble=\"'$(preamble)'\" build/d3.js -c negate_iife=false -m -o build/d3.min.js",
"postpublish": "git push && git push --tags && cd ../d3.github.com && git pull && cp ../d3/build/d3.js d3.v4.js && cp ../d3/build/d3.min.js d3.v4.min.js && git add d3.v4.js d3.v4.min.js && git commit -m \"d3 ${npm_package_version}\" && git push && cd - && cd ../d3-bower && git pull && cp ../d3/LICENSE ../d3/README.md ../d3/build/d3.js ../d3/build/d3.min.js . && git add -- LICENSE README.md d3.js d3.min.js && git commit -m \"${npm_package_version}\" && git tag -am \"${npm_package_version}\" v${npm_package_version} && git push && git push --tags && cd - && zip -j build/d3.zip -- LICENSE README.md API.md CHANGES.md build/d3.js build/d3.min.js"
},
"devDependencies": {
"json2module": "0.0",
"package-preamble": "0.1",
"rimraf": "2",
"rollup": "^0.45.2",
"rollup": "0.49",
"rollup-plugin-ascii": "0.0",
"rollup-plugin-node-resolve": "3",
"tape": "^4.7.0",
"uglify-js": "^3.0.24"
"tape": "4",
"uglify-js": "3"
},
"dependencies": {
"d3-array": "1.2.0",
@ -48,7 +49,7 @@
"d3-color": "1.0.3",
"d3-dispatch": "1.0.3",
"d3-drag": "1.1.1",
"d3-dsv": "1.0.5",
"d3-dsv": "1.0.7",
"d3-ease": "1.0.3",
"d3-force": "1.0.6",
"d3-format": "1.2.0",
@ -60,7 +61,7 @@
"d3-quadtree": "1.0.3",
"d3-queue": "3.0.7",
"d3-random": "1.1.0",
"d3-request": "1.0.5",
"d3-request": "1.0.6",
"d3-scale": "1.0.6",
"d3-selection": "1.1.0",
"d3-shape": "1.2.0",

Просмотреть файл

@ -2,9 +2,12 @@ import ascii from "rollup-plugin-ascii";
import node from "rollup-plugin-node-resolve";
export default {
entry: "index",
input: "index",
extend: true,
format: "umd",
moduleName: "d3",
plugins: [node(), ascii()]
plugins: [node(), ascii()],
output: {
file: "build/d3.js",
format: "umd",
name: "d3"
}
};

Просмотреть файл

@ -3,7 +3,7 @@ var fs = require("fs"),
dependencies = require("./package.json").dependencies;
rollup.rollup({
entry: "index.js",
input: "index.js",
external: Object.keys(dependencies)
}).then(function(bundle) {
return bundle.generate({format: "cjs"});