upgrade from rollup v1 to v2

so we can use ?. optional chaining
This commit is contained in:
Bruno Windels 2020-08-19 11:27:35 +02:00
parent ab05ca76f3
commit 6813fd2264
3 changed files with 15 additions and 17 deletions

View file

@ -40,7 +40,7 @@
"postcss-import": "^12.0.1", "postcss-import": "^12.0.1",
"postcss-url": "^8.0.0", "postcss-url": "^8.0.0",
"regenerator-runtime": "^0.13.7", "regenerator-runtime": "^0.13.7",
"rollup": "^1.15.6", "rollup": "^2.26.4",
"rollup-plugin-cleanup": "^3.1.1", "rollup-plugin-cleanup": "^3.1.1",
"serve-static": "^1.13.2", "serve-static": "^1.13.2",
"xxhash": "^0.3.0" "xxhash": "^0.3.0"

View file

@ -20,7 +20,7 @@ import fsRoot from "fs";
const fs = fsRoot.promises; const fs = fsRoot.promises;
import path from "path"; import path from "path";
import XXHash from 'xxhash'; import XXHash from 'xxhash';
import rollup from 'rollup'; import { rollup } from 'rollup';
import postcss from "postcss"; import postcss from "postcss";
import postcssImport from "postcss-import"; import postcssImport from "postcss-import";
import { fileURLToPath } from 'url'; import { fileURLToPath } from 'url';
@ -174,7 +174,7 @@ async function buildHtml(doc, version, assetPaths, manifestPath) {
async function buildJs() { async function buildJs() {
// create js bundle // create js bundle
const bundle = await rollup.rollup({ const bundle = await rollup({
input: 'src/main.js', input: 'src/main.js',
plugins: [removeJsComments({comments: "none"})] plugins: [removeJsComments({comments: "none"})]
}); });
@ -209,7 +209,7 @@ async function buildJsLegacy() {
input: ['src/legacy-polyfill.js', 'src/main.js'], input: ['src/legacy-polyfill.js', 'src/main.js'],
plugins: [multi(), commonjs(), nodeResolve(), babelPlugin, removeJsComments({comments: "none"})] plugins: [multi(), commonjs(), nodeResolve(), babelPlugin, removeJsComments({comments: "none"})]
}; };
const bundle = await rollup.rollup(rollupConfig); const bundle = await rollup(rollupConfig);
const {output} = await bundle.generate({ const {output} = await bundle.generate({
format: 'iife', format: 'iife',
name: `${PROJECT_ID}Bundle` name: `${PROJECT_ID}Bundle`

View file

@ -902,11 +902,6 @@
dependencies: dependencies:
"@types/node" "*" "@types/node" "*"
acorn@^7.1.0:
version "7.1.1"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.1.1.tgz#e35668de0b402f359de515c5482a1ab9f89a69bf"
integrity sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==
ansi-styles@^3.2.1: ansi-styles@^3.2.1:
version "3.2.1" version "3.2.1"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d"
@ -1252,6 +1247,11 @@ fs.realpath@^1.0.0:
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8=
fsevents@~2.1.2:
version "2.1.3"
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e"
integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==
function-bind@^1.1.1: function-bind@^1.1.1:
version "1.1.1" version "1.1.1"
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
@ -1810,14 +1810,12 @@ rollup-pluginutils@^2.3.3:
dependencies: dependencies:
estree-walker "^0.6.1" estree-walker "^0.6.1"
rollup@^1.15.6: rollup@^2.26.4:
version "1.32.1" version "2.26.4"
resolved "https://registry.yarnpkg.com/rollup/-/rollup-1.32.1.tgz#4480e52d9d9e2ae4b46ba0d9ddeaf3163940f9c4" resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.26.4.tgz#a8350fd6bd56fce9873a7db2bd9547d40de3992b"
integrity sha512-/2HA0Ec70TvQnXdzynFffkjA6XN+1e2pEv/uKS5Ulca40g2L7KuOE3riasHoNVHOsFD5KKZgDsMk1CP3Tw9s+A== integrity sha512-6+qsGuP0MXGd7vlYmk72utm1MrgZj5GfXibGL+cRkKQ9+ZL/BnFThDl0D5bcl7AqlzMjAQXRAwZX1HVm22M/4Q==
dependencies: optionalDependencies:
"@types/estree" "*" fsevents "~2.1.2"
"@types/node" "*"
acorn "^7.1.0"
safe-buffer@~5.1.1: safe-buffer@~5.1.1:
version "5.1.2" version "5.1.2"