-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adopting a dual dist/ bundled UMD and bundled ES Module strategy.
- Loading branch information
Showing
3 changed files
with
50 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,30 @@ | ||
import node from "rollup-plugin-node-resolve"; | ||
import uglify from "rollup-plugin-uglify"; | ||
|
||
export default { | ||
input: "src/index.js", | ||
plugins: [ | ||
node() | ||
], | ||
output: { | ||
extend: true, | ||
banner: `// @observablehq/notebook-stdlib Copyright ${(new Date).getFullYear()} Observable, Inc.`, | ||
file: "dist/notebook-stdlib.js", | ||
format: "umd", | ||
name: "Observable" | ||
} | ||
const defaultOutput = { | ||
banner: `// @observablehq/notebook-stdlib Copyright ${(new Date).getFullYear()} Observable, Inc.`, | ||
}; | ||
|
||
function config(output) { | ||
return { | ||
input: "src/index.js", | ||
plugins: [ | ||
node(), | ||
uglify() | ||
], | ||
output: Object.assign(output, defaultOutput) | ||
}; | ||
} | ||
|
||
export default [ | ||
config({ | ||
format: "es", | ||
file: "dist/notebook-stdlib.js" | ||
}), | ||
config({ | ||
format: "umd", | ||
extend: true, | ||
name: "Observable", | ||
file: "dist/notebook-stdlib.umd.js" | ||
}) | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -228,6 +228,10 @@ combined-stream@^1.0.5, combined-stream@~1.0.5: | |
dependencies: | ||
delayed-stream "~1.0.0" | ||
|
||
commander@~2.13.0: | ||
version "2.13.0" | ||
resolved "https://registry.yarnpkg.com/commander/-/commander-2.13.0.tgz#6964bca67685df7c1f1430c584f07d7597885b9c" | ||
|
||
[email protected]: | ||
version "0.0.1" | ||
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" | ||
|
@@ -1138,6 +1142,12 @@ rollup-plugin-node-resolve@^3.0.0: | |
is-module "^1.0.0" | ||
resolve "^1.1.6" | ||
|
||
rollup-plugin-uglify@^3.0.0: | ||
version "3.0.0" | ||
resolved "https://registry.yarnpkg.com/rollup-plugin-uglify/-/rollup-plugin-uglify-3.0.0.tgz#a34eca24617709c6bf1778e9653baafa06099b86" | ||
dependencies: | ||
uglify-es "^3.3.7" | ||
|
||
rollup@^0.52.0: | ||
version "0.52.3" | ||
resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.52.3.tgz#020d99fffe9619351e47b3894fd397c26f5e1bf6" | ||
|
@@ -1200,6 +1210,10 @@ source-map@~0.5.6: | |
version "0.5.7" | ||
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" | ||
|
||
source-map@~0.6.1: | ||
version "0.6.1" | ||
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" | ||
|
||
sprintf-js@~1.0.2: | ||
version "1.0.3" | ||
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" | ||
|
@@ -1360,6 +1374,13 @@ typedarray@^0.0.6: | |
version "0.0.6" | ||
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" | ||
|
||
uglify-es@^3.3.7: | ||
version "3.3.9" | ||
resolved "https://registry.yarnpkg.com/uglify-es/-/uglify-es-3.3.9.tgz#0c1c4f0700bed8dbc124cdb304d2592ca203e677" | ||
dependencies: | ||
commander "~2.13.0" | ||
source-map "~0.6.1" | ||
|
||
ultron@~1.1.0: | ||
version "1.1.1" | ||
resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.1.1.tgz#9fe1536a10a664a65266a1e3ccf85fd36302bc9c" | ||
|