From 2a65f671495b368504254aca4c56c2ccf7ba1d39 Mon Sep 17 00:00:00 2001 From: vulcangz Date: Tue, 23 Feb 2021 21:33:03 +0800 Subject: [PATCH] chore: fix build bug --- package-lock.json | 8 +- package.json | 5 +- rollup.config.js | 196 +++++++++++++++++++++++----------------------- 3 files changed, 105 insertions(+), 104 deletions(-) diff --git a/package-lock.json b/package-lock.json index 67df9b9..a866f38 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@vulcangz/svelte-baidumaps", - "version": "0.1.0", + "version": "0.1.1", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -1933,9 +1933,9 @@ "dev": true }, "caniuse-lite": { - "version": "1.0.30001116", - "resolved": "https://registry.npm.taobao.org/caniuse-lite/download/caniuse-lite-1.0.30001116.tgz?cache=0&sync_timestamp=1597783991061&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcaniuse-lite%2Fdownload%2Fcaniuse-lite-1.0.30001116.tgz", - "integrity": "sha1-86Peo0f5KUo73EKSMJA5zIQRf7g=", + "version": "1.0.30001191", + "resolved": "https://registry.npm.taobao.org/caniuse-lite/download/caniuse-lite-1.0.30001191.tgz?cache=0&sync_timestamp=1613979294700&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcaniuse-lite%2Fdownload%2Fcaniuse-lite-1.0.30001191.tgz", + "integrity": "sha1-ustDK2cB9pDIxffGgBZrmp8IQ9k=", "dev": true }, "caseless": { diff --git a/package.json b/package.json index 339bc09..fb67b87 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "test": "start-server-and-test dev http://localhost:5000 cy:run" }, "svelte": "src/components/components.module.js", - "version": "0.1.0", + "version": "0.1.1", "devDependencies": { "@babel/core": "7.11.5", "@babel/plugin-syntax-dynamic-import": "7.8.3", @@ -76,5 +76,6 @@ "bugs": { "url": "https://github.com/vulcangz/svelte-baidumaps/issues" }, - "homepage": "https://github.com/vulcangz/svelte-baidumaps#readme" + "homepage": "https://github.com/vulcangz/svelte-baidumaps#readme", + "dependencies": {} } diff --git a/rollup.config.js b/rollup.config.js index b3b78db..d516bc2 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,111 +1,111 @@ -import { terser } from 'rollup-plugin-terser'; -import autoPreprocess from 'svelte-preprocess'; -import babel from 'rollup-plugin-babel'; -import commonjs from 'rollup-plugin-commonjs'; -import livereload from 'rollup-plugin-livereload'; -import pkg from './package.json'; -import resolve from 'rollup-plugin-node-resolve'; -import svelte from 'rollup-plugin-svelte'; +import { terser } from 'rollup-plugin-terser' +import autoPreprocess from 'svelte-preprocess' +import babel from 'rollup-plugin-babel' +import commonjs from 'rollup-plugin-commonjs' +import livereload from 'rollup-plugin-livereload' +import pkg from './package.json' +import resolve from 'rollup-plugin-node-resolve' +import svelte from 'rollup-plugin-svelte' -const production = !process.env.ROLLUP_WATCH; +const production = !process.env.ROLLUP_WATCH const name = pkg.name - .replace(/^(@\S+\/)?(svelte-)?(\S+)/, '$3') - .replace(/^\w/, (m) => m.toUpperCase()) - .replace(/-\w/g, (m) => m[1].toUpperCase()); + .replace(/^(@\S+\/)?(svelte-)?(\S+)/, '$3') + .replace(/^\w/, (m) => m.toUpperCase()) + .replace(/-\w/g, (m) => m[1].toUpperCase()) export default { - input: !production ? 'src/main.js' : 'src/components/components.module.js', - output: !production - ? { - sourcemap: true, - format: 'iife', - name: 'app', - file: 'public/bundle.js', - } - : [ - { - file: pkg.module, - format: 'es', - sourcemap: true, - name, - }, - { - file: pkg.main, - format: 'umd', - sourcemap: true, - name, - }, - ], - plugins: [ - babel({ - runtimeHelpers: true, - }), - svelte({ - // enable run-time checks when not in production - dev: !production, - // we'll extract any component CSS out into - // a separate file — better for performance - css: (css) => { - css.write('bundle.css'); - }, + input: !production ? 'src/main.js' : 'src/components/components.module.js', + output: !production + ? { + sourcemap: true, + format: 'iife', + name: 'app', + file: 'public/bundle.js' + } + : [ + { + file: pkg.module, + format: 'es', + sourcemap: true, + name + }, + { + file: pkg.main, + format: 'umd', + sourcemap: true, + name + } + ], + plugins: [ + babel({ + runtimeHelpers: true + }), + svelte({ + // enable run-time checks when not in production + dev: !production, + // we'll extract any component CSS out into + // a separate file — better for performance + css: (css) => { + css.write('bundle.css') + }, - /** - * Auto preprocess supported languages with - * '